#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(void) {
  printf("%+d\n", 3);
  printf("%-4d, %4d\n", 3, 3);
  printf("%04d\n", 3);
  printf("%#x, %x\n", 30, 30);
  printf("%#o, %o\n", 30, 30);
  printf("%#g, %g\n", 3.14, 3.14);
  printf("%5d, %10f\n", 3, 3.14);
  printf("%-5s, %-5d\n", "abc", 123);
  printf("%*d\n", 5, 3);
  printf("%05d, %05d\n", 3, -3);
  printf("%7.2f, %7.5f\n", 3.1416, 3.1416);
  printf("%.2g, %.9g\n", 3.1416, 3.1416);
  printf("%5.2d, %5.2d\n", 3, 1234);
  printf("%*.*d\n", 5, 3, 3);
  printf("%5.2s, %5.4s\n", "abc", "ab");
  printf("%e\n", 123.456);
  printf("%13.2e\n", 123.456);
  printf("%g\n", 123.456);
  printf("%g\n", 0.0000123456789);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x3,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x1e,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x1e,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
movsd  0xe85(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x3,%esi
movsd  0xe67(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    0xea2(%rip),%rsi
mov    $0x7b,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x3,%esi
mov    $0xfffffffd,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
movsd  0xdff(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
movsd  0xde6(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe5c(%rip),%rdi
mov    $0x3,%esi
mov    $0x4d2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe52(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3f(%rip),%rdi
lea    0xdf4(%rip),%rsi
lea    0xe3f(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe34(%rip),%rdi
movsd  0xd77(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe22(%rip),%rdi
movsd  0xd61(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd98(%rip),%rdi
movsd  0xd4b(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd82(%rip),%rdi
movsd  0xd2d(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf08(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x3,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1e,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1e,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
movsd  0xe72(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x3,%esi
movsd  0xe54(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    0xea7(%rip),%rbx
mov    %rbx,%rsi
mov    $0x7b,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x3,%esi
mov    $0xfffffffd,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
movsd  0xdf9(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe6b(%rip),%rdi
movsd  0xde0(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
mov    $0x3,%esi
mov    $0x4d2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe3e(%rip),%rdi
lea    0xe45(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe37(%rip),%rdi
movsd  0xd82(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe25(%rip),%rdi
movsd  0xd6c(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd9b(%rip),%rbx
mov    %rbx,%rdi
movsd  0xd53(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd4c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%+d\0A\00"
@.str.1 = [11 x i8] c"%-4d, %4d\0A\00"
@.str.2 = [6 x i8] c"%04d\0A\00"
@.str.3 = [9 x i8] c"%#x, %x\0A\00"
@.str.4 = [9 x i8] c"%#o, %o\0A\00"
@.str.5 = [9 x i8] c"%#g, %g\0A\00"
@.str.6 = [11 x i8] c"%5d, %10f\0A\00"
@.str.7 = [12 x i8] c"%-5s, %-5d\0A\00"
@.str.8 = [4 x i8] c"abc\00"
@.str.9 = [5 x i8] c"%*d\0A\00"
@.str.10 = [12 x i8] c"%05d, %05d\0A\00"
@.str.11 = [14 x i8] c"%7.2f, %7.5f\0A\00"
@.str.12 = [12 x i8] c"%.2g, %.9g\0A\00"
@.str.13 = [14 x i8] c"%5.2d, %5.2d\0A\00"
@.str.14 = [7 x i8] c"%*.*d\0A\00"
@.str.15 = [14 x i8] c"%5.2s, %5.4s\0A\00"
@.str.16 = [3 x i8] c"ab\00"
@.str.17 = [4 x i8] c"%e\0A\00"
@.str.18 = [8 x i8] c"%13.2e\0A\00"
@.str.19 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 3)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 30, i32 30)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 30, i32 30)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), double 3.140000e+00, double 3.140000e+00)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 3, double 3.140000e+00)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 123)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 5, i32 3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 3, i32 -3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), double 3.141600e+00, double 3.141600e+00)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), double 3.141600e+00, double 3.141600e+00)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i32 3, i32 1234)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 5, i32 3, i32 3)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), double 1.234560e+02)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), double 1.234560e+02)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double 1.234560e+02)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double 0x3EE9E409301B5A02)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%+d\0A\00"
@.str.1 = [11 x i8] c"%-4d, %4d\0A\00"
@.str.2 = [6 x i8] c"%04d\0A\00"
@.str.3 = [9 x i8] c"%#x, %x\0A\00"
@.str.4 = [9 x i8] c"%#o, %o\0A\00"
@.str.5 = [9 x i8] c"%#g, %g\0A\00"
@.str.6 = [11 x i8] c"%5d, %10f\0A\00"
@.str.7 = [12 x i8] c"%-5s, %-5d\0A\00"
@.str.8 = [4 x i8] c"abc\00"
@.str.9 = [5 x i8] c"%*d\0A\00"
@.str.10 = [12 x i8] c"%05d, %05d\0A\00"
@.str.11 = [14 x i8] c"%7.2f, %7.5f\0A\00"
@.str.12 = [12 x i8] c"%.2g, %.9g\0A\00"
@.str.13 = [14 x i8] c"%5.2d, %5.2d\0A\00"
@.str.14 = [7 x i8] c"%*.*d\0A\00"
@.str.15 = [14 x i8] c"%5.2s, %5.4s\0A\00"
@.str.16 = [3 x i8] c"ab\00"
@.str.17 = [4 x i8] c"%e\0A\00"
@.str.18 = [8 x i8] c"%13.2e\0A\00"
@.str.19 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 3)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 30, i32 30)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 30, i32 30)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), double 3.140000e+00, double 3.140000e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 3, double 3.140000e+00)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 123)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 5, i32 3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 3, i32 -3)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), double 3.141600e+00, double 3.141600e+00)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), double 3.141600e+00, double 3.141600e+00)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i32 3, i32 1234)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 5, i32 3, i32 3)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), double 1.234560e+02)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), double 1.234560e+02)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double 1.234560e+02)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double 0x3EE9E409301B5A02)
ret i32 0
}