#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() {
  printf("%d\n", 1, 2);
  printf("%*d\n", 1, 2);
  printf("%**d\n", 1, 2, 3);
  printf("%*%*d\n", 1, 2, 3);
  printf("%*%*%d\n", 1, 2, 3);
  printf("**%d\n", 1, 2, 3);
  printf("%**%d\n", 1, 2, 3);
  printf("%* *%d\n", 1, 2, 3);
  printf("%* %*%d\n", 1, 2, 3);
  printf("%4d\n%4d\n", 12345, 678);
  printf("%6d\n%6d\n", 12345, 678);
  printf("%*2$d\n", 1, 2);
  printf("%.3d\n", 1, 2);
  printf("%.*2$d\n", 1, 2);
  printf("%.3f\n", 1.12345, 2);
  printf("%.*2$f\n", 1.12345, 2);
  printf("%m\n");
  int i;
  printf("asdf%n\n", &i);
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf02(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe28(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe14(%rip),%rdi
mov    $0x3039,%esi
mov    $0x2a6,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe05(%rip),%rdi
mov    $0x3039,%esi
mov    $0x2a6,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf6(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde5(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd3(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdc3(%rip),%rdi
movsd  0xd5f(%rip),%xmm0
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdae(%rip),%rdi
movsd  0xd44(%rip),%xmm0
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd91(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xd36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf0c(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe44(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe2f(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe1b(%rip),%rdi
mov    $0x3039,%esi
mov    $0x2a6,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe0c(%rip),%rdi
mov    $0x3039,%esi
mov    $0x2a6,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdfd(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdec(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdca(%rip),%rdi
movsd  0xd66(%rip),%xmm0
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdb5(%rip),%rdi
movsd  0xd4b(%rip),%xmm0
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xda2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd98(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%*d\0A\00"
@.str.2 = [6 x i8] c"%**d\0A\00"
@.str.3 = [7 x i8] c"%*%*d\0A\00"
@.str.4 = [8 x i8] c"%*%*%d\0A\00"
@.str.5 = [6 x i8] c"**%d\0A\00"
@.str.6 = [7 x i8] c"%**%d\0A\00"
@.str.7 = [8 x i8] c"%* *%d\0A\00"
@.str.8 = [9 x i8] c"%* %*%d\0A\00"
@.str.9 = [9 x i8] c"%4d\0A%4d\0A\00"
@.str.10 = [9 x i8] c"%6d\0A%6d\0A\00"
@.str.11 = [7 x i8] c"%*2$d\0A\00"
@.str.12 = [6 x i8] c"%.3d\0A\00"
@.str.13 = [8 x i8] c"%.*2$d\0A\00"
@.str.14 = [6 x i8] c"%.3f\0A\00"
@.str.15 = [8 x i8] c"%.*2$f\0A\00"
@.str.16 = [4 x i8] c"%m\0A\00"
@.str.17 = [8 x i8] c"asdf%n\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 2, i32 3)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 2, i32 3)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 2, i32 3)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 2, i32 3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 2, i32 3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 1, i32 2, i32 3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 1, i32 2, i32 3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 12345, i32 678)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 12345, i32 678)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 1, i32 2)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 1, i32 2)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 1, i32 2)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), double 1.123450e+00, i32 2)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), double 1.123450e+00, i32 2)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%*d\0A\00"
@.str.2 = [6 x i8] c"%**d\0A\00"
@.str.3 = [7 x i8] c"%*%*d\0A\00"
@.str.4 = [8 x i8] c"%*%*%d\0A\00"
@.str.5 = [6 x i8] c"**%d\0A\00"
@.str.6 = [7 x i8] c"%**%d\0A\00"
@.str.7 = [8 x i8] c"%* *%d\0A\00"
@.str.8 = [9 x i8] c"%* %*%d\0A\00"
@.str.9 = [9 x i8] c"%4d\0A%4d\0A\00"
@.str.10 = [9 x i8] c"%6d\0A%6d\0A\00"
@.str.11 = [7 x i8] c"%*2$d\0A\00"
@.str.12 = [6 x i8] c"%.3d\0A\00"
@.str.13 = [8 x i8] c"%.*2$d\0A\00"
@.str.14 = [6 x i8] c"%.3f\0A\00"
@.str.15 = [8 x i8] c"%.*2$f\0A\00"
@.str.16 = [4 x i8] c"%m\0A\00"
@.str.17 = [8 x i8] c"asdf%n\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 2, i32 3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 2, i32 3)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 2, i32 3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 2, i32 3)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 2, i32 3)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 1, i32 2, i32 3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 1, i32 2, i32 3)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 12345, i32 678)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 12345, i32 678)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 1, i32 2)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 1, i32 2)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 1, i32 2)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), double 1.123450e+00, i32 2)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), double 1.123450e+00, i32 2)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%19 = bitcast i32* %1 to i8*
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i32* %1)
%21 = load i32, i32* %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}