int main(void) {
  long a = 10;
  long long b = 10;
  printf("Strings:\n");
  const char *s = "Hello";
  printf("\t.%10s.\n\t.%-10s.\n\t.%*s.\n", s, s, 10, s);
  printf("Integers\n");
  printf("Decimal:\t%i %d %.6i %i %.0i %+i %u\n", 1, 2, 3, 0, 0, 4, -1);
  printf("Hexadecimal:\t%x %x %X %#x\n", 5, 10, 10, 6);
  printf("Octal:\t%o %#o %#o\n", 10, 10, 4);
  printf("Floating point\n");
  printf("Rounding:\t%f %.0f %.32f\n", 1.5, 1.5, 1.3);
  printf("Padding:\t%05.2f %.2f %5.2f\n", 1.5, 1.5, 1.5);
  printf("Scientific:\t%E %e\n", 1.5, 1.5);
  printf("Hexadecimal:\t%a %A\n", 1.5, 1.5);
  printf("=============================\n");
  printf("test ld : %Ld\n", b);
  printf("test lld : %lld\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    0xec5(%rip),%rdi
mov    $0xa,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x4,(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%ecx
mov    $0x6,%r8d
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0xa,%edx
mov    $0x4,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
movsd  0xe02(%rip),%xmm1
movsd  0xe02(%rip),%xmm2
movaps %xmm1,%xmm0
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
movsd  0xde1(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
movsd  0xdc5(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
movsd  0xdac(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xfd5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
lea    0xed5(%rip),%rdx
mov    %rdx,%rsi
mov    $0xa,%ecx
mov    %rdx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   $0xffffffffffffffff
push   $0x4
call   1040 <printf@plt>
add    $0x10,%rsp
lea    0xec8(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0x6,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf44(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
movsd  0xe21(%rip),%xmm0
movsd  0xe21(%rip),%xmm2
movaps %xmm0,%xmm1
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
movsd  0xe00(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
movsd  0xde4(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
movsd  0xdcb(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8b(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Strings:\0A\00"
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [25 x i8] c"\09.%10s.\0A\09.%-10s.\0A\09.%*s.\0A\00"
@.str.3 = [10 x i8] c"Integers\0A\00"
@.str.4 = [36 x i8] c"Decimal:\09%i %d %.6i %i %.0i %+i %u\0A\00"
@.str.5 = [27 x i8] c"Hexadecimal:\09%x %x %X %#x\0A\00"
@.str.6 = [19 x i8] c"Octal:\09%o %#o %#o\0A\00"
@.str.7 = [16 x i8] c"Floating point\0A\00"
@.str.8 = [25 x i8] c"Rounding:\09%f %.0f %.32f\0A\00"
@.str.9 = [28 x i8] c"Padding:\09%05.2f %.2f %5.2f\0A\00"
@.str.10 = [19 x i8] c"Scientific:\09%E %e\0A\00"
@.str.11 = [20 x i8] c"Hexadecimal:\09%a %A\0A\00"
@.str.12 = [31 x i8] c"=============================\0A\00"
@.str.13 = [15 x i8] c"test ld : %Ld\0A\00"
@.str.14 = [17 x i8] c"test lld : %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
store i32 0, i32* %1
store i64 10, i64* %2
store i64 10, i64* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %7, i32 10, i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 2, i32 3, i32 0, i32 0, i32 4, i32 -1)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 5, i32 10, i32 10, i32 6)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 10, i32 10, i32 4)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00, double 1.300000e+00)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00, double 1.500000e+00)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
%20 = load i64, i64* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i64 %20)
%22 = load i64, i64* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i64 %22)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [25 x i8] c"\09.%10s.\0A\09.%-10s.\0A\09.%*s.\0A\00"
@.str.4 = [36 x i8] c"Decimal:\09%i %d %.6i %i %.0i %+i %u\0A\00"
@.str.5 = [27 x i8] c"Hexadecimal:\09%x %x %X %#x\0A\00"
@.str.6 = [19 x i8] c"Octal:\09%o %#o %#o\0A\00"
@.str.8 = [25 x i8] c"Rounding:\09%f %.0f %.32f\0A\00"
@.str.9 = [28 x i8] c"Padding:\09%05.2f %.2f %5.2f\0A\00"
@.str.10 = [19 x i8] c"Scientific:\09%E %e\0A\00"
@.str.11 = [20 x i8] c"Hexadecimal:\09%a %A\0A\00"
@.str.13 = [15 x i8] c"test ld : %Ld\0A\00"
@.str.14 = [17 x i8] c"test lld : %lld\0A\00"
@str = [9 x i8] c"Strings:\00"
@str.15 = [9 x i8] c"Integers\00"
@str.16 = [15 x i8] c"Floating point\00"
@str.17 = [30 x i8] c"=============================\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 2, i32 3, i32 0, i32 0, i32 4, i32 -1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 5, i32 10, i32 10, i32 6)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 10, i32 10, i32 4)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00, double 1.300000e+00)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00, double 1.500000e+00)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double 1.500000e+00, double 1.500000e+00)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.17, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i64 10)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i64 10)
ret i32 0
}