int main(void) {
  printf("[%-2d]\n", 1);
  printf("[%-5.2f]\n", 1.256);
  printf("[%*.*s]\n", 5, 3, "hmmly");
  printf("%c,[%*c]\n", 'a', 3, 'c');
  int i = 1, j = 5;
  for (; j > 1; i += 2, j--)
    printf("%*c%*c\n", j, '/', i, '\\');
  for (i = 0; i < 10; i++)
    printf("%c", '-');
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
movsd  0xebf(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
lea    0xec3(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x61,%esi
mov    $0x3,%edx
mov    $0x63,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    11d2 <main+0xc2>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xe8a(%rip),%rdi
mov    $0x2f,%edx
mov    $0x5c,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1192 <main+0x82>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1204 <main+0xf4>
lea    0xe51(%rip),%rdi
mov    $0x2d,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d9 <main+0xc9>
lea    0xe26(%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
lea    0xee0(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
movsd  0xebd(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0xecb(%rip),%rcx
mov    $0x5,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x61,%esi
mov    $0x3,%edx
mov    $0x63,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2f,%edx
mov    $0x1,%ecx
mov    $0x5c,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2f,%edx
mov    $0x3,%ecx
mov    $0x5c,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2f,%edx
mov    $0x5,%ecx
mov    $0x5c,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2f,%edx
mov    $0x7,%ecx
mov    $0x5c,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"[%-2d]\0A\00"
@.str.1 = [10 x i8] c"[%-5.2f]\0A\00"
@.str.2 = [9 x i8] c"[%*.*s]\0A\00"
@.str.3 = [6 x i8] c"hmmly\00"
@.str.4 = [10 x i8] c"%c,[%*c]\0A\00"
@.str.5 = [8 x i8] c"%*c%*c\0A\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 1.256000e+00)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 97, i32 3, i32 99)
store i32 1, i32* %2
store i32 5, i32* %3
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %12, i32 47, i32 %13, i32 92)
br label %15
15: ; preds = %11
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 2
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
br label %8
20: ; preds = %8
store i32 0, i32* %2
br label %21
21: ; preds = %26, %20
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 45)
br label %26
26: ; preds = %24
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %21
29: ; preds = %21
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"[%-2d]\0A\00"
@.str.1 = [10 x i8] c"[%-5.2f]\0A\00"
@.str.2 = [9 x i8] c"[%*.*s]\0A\00"
@.str.3 = [6 x i8] c"hmmly\00"
@.str.4 = [10 x i8] c"%c,[%*c]\0A\00"
@.str.5 = [8 x i8] c"%*c%*c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 1.256000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 97, i32 3, i32 99)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 5, i32 47, i32 1, i32 92)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 47, i32 3, i32 92)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 3, i32 47, i32 5, i32 92)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 2, i32 47, i32 7, i32 92)
%9 = tail call i32 @putchar(i32 45)
%10 = tail call i32 @putchar(i32 45)
%11 = tail call i32 @putchar(i32 45)
%12 = tail call i32 @putchar(i32 45)
%13 = tail call i32 @putchar(i32 45)
%14 = tail call i32 @putchar(i32 45)
%15 = tail call i32 @putchar(i32 45)
%16 = tail call i32 @putchar(i32 45)
%17 = tail call i32 @putchar(i32 45)
%18 = tail call i32 @putchar(i32 45)
%19 = tail call i32 @putchar(i32 10)
ret i32 0
}