int main() {
  if (printf("%*c\n", 5, 'a') != 6) {
    abort();
  }
  if (printf("%*d\n", 20, 1) != 21) {
    abort();
  }
  if (printf("%*d\n", 20, 12312312) != 21) {
    abort();
  }
  if (printf("%*d\n", 3, 2) != 4) {
    abort();
  }
  if (printf("%*d\n", 3, 221) != 4) {
    abort();
  }
  if (printf("%*d\n", 3, -221) != 5) {
    abort();
  }
  if (printf("%*d\n", 3, 5221) != 5) {
    abort();
  }
  if (printf("%*d\n", 0, 5221) != 5) {
    abort();
  }
  if (printf("%*ld\n", 3, 221L) != 4) {
    abort();
  }
  if (printf("%*ld\n", 3, -221L) != 5) {
    abort();
  }
  if (printf("%*ld\n", 3, 5221L) != 5) {
    abort();
  }
  if (printf("%*s\n", 5, "a") != 6) {
    abort();
  }
  if (printf("%*s\n", 5, "asdfg") != 6) {
    abort();
  }
  if (printf("%*s\n", 5, "asdfgasdf") != 10) {
    abort();
  }
  if (printf("%*f\n", 30, 324.324) != 31) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xedd(%rip),%rdi
mov    $0x5,%esi
mov    $0x61,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x6,%eax
je     114a <main+0x2a>
call   1030 <abort@plt>
lea    0xebc(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x15,%eax
je     1170 <main+0x50>
call   1030 <abort@plt>
lea    0xe96(%rip),%rdi
mov    $0x14,%esi
mov    $0xbbdef8,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x15,%eax
je     1196 <main+0x76>
call   1030 <abort@plt>
lea    0xe70(%rip),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x4,%eax
je     11bc <main+0x9c>
call   1030 <abort@plt>
lea    0xe4a(%rip),%rdi
mov    $0x3,%esi
mov    $0xdd,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x4,%eax
je     11e2 <main+0xc2>
call   1030 <abort@plt>
lea    0xe24(%rip),%rdi
mov    $0x3,%esi
mov    $0xffffff23,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x5,%eax
je     1208 <main+0xe8>
call   1030 <abort@plt>
lea    0xdfe(%rip),%rdi
mov    $0x3,%esi
mov    $0x1465,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x5,%eax
je     122e <main+0x10e>
call   1030 <abort@plt>
lea    0xdd8(%rip),%rdi
xor    %esi,%esi
mov    $0x1465,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x5,%eax
je     1251 <main+0x131>
call   1030 <abort@plt>
lea    0xdba(%rip),%rdi
mov    $0x3,%esi
mov    $0xdd,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x4,%eax
je     1277 <main+0x157>
call   1030 <abort@plt>
lea    0xd94(%rip),%rdi
mov    $0x3,%esi
mov    $0xffffffffffffff23,%rdx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x5,%eax
je     129f <main+0x17f>
call   1030 <abort@plt>
lea    0xd6c(%rip),%rdi
mov    $0x3,%esi
mov    $0x1465,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x5,%eax
je     12c5 <main+0x1a5>
call   1030 <abort@plt>
lea    0xd4c(%rip),%rdi
mov    $0x5,%esi
lea    0xd45(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x6,%eax
je     12ed <main+0x1cd>
call   1030 <abort@plt>
lea    0xd24(%rip),%rdi
mov    $0x5,%esi
lea    0xd1f(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0x6,%eax
je     1315 <main+0x1f5>
call   1030 <abort@plt>
lea    0xcfc(%rip),%rdi
mov    $0x5,%esi
lea    0xcfd(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
cmp    $0xa,%eax
je     133d <main+0x21d>
call   1030 <abort@plt>
lea    0xceb(%rip),%rdi
mov    $0x1e,%esi
movsd  0xcaf(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
cmp    $0x1f,%eax
je     1366 <main+0x246>
call   1030 <abort@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    $0x5,%esi
mov    $0x61,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x6,%eax
jne    130c <main+0x1ec>
lea    0xec4(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x15,%eax
jne    130c <main+0x1ec>
lea    0xea3(%rip),%rdi
mov    $0x14,%esi
mov    $0xbbdef8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x15,%eax
jne    130c <main+0x1ec>
lea    0xe82(%rip),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%eax
jne    130c <main+0x1ec>
lea    0xe61(%rip),%rdi
mov    $0x3,%esi
mov    $0xdd,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%eax
jne    130c <main+0x1ec>
lea    0xe40(%rip),%rdi
mov    $0x3,%esi
mov    $0xffffff23,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x5,%eax
jne    130c <main+0x1ec>
lea    0xe1f(%rip),%rdi
mov    $0x3,%esi
mov    $0x1465,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x5,%eax
jne    130c <main+0x1ec>
lea    0xdfe(%rip),%rdi
xor    %esi,%esi
mov    $0x1465,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x5,%eax
jne    130c <main+0x1ec>
lea    0xde5(%rip),%rdi
mov    $0xdd,%edx
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%eax
jne    130c <main+0x1ec>
lea    0xdc4(%rip),%rdi
mov    $0x3,%esi
mov    $0xffffffffffffff23,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x5,%eax
jne    130c <main+0x1ec>
lea    0xda1(%rip),%rdi
mov    $0x1465,%edx
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x5,%eax
jne    130c <main+0x1ec>
lea    0xd86(%rip),%rdi
lea    0xd84(%rip),%rdx
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x6,%eax
jne    130c <main+0x1ec>
lea    0xd67(%rip),%rdi
lea    0xd67(%rip),%rdx
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x6,%eax
jne    130c <main+0x1ec>
lea    0xd48(%rip),%rdi
lea    0xd4e(%rip),%rdx
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0xa,%eax
jne    130c <main+0x1ec>
lea    0xd40(%rip),%rdi
movsd  0xd09(%rip),%xmm0
mov    $0x1e,%esi
mov    $0x1,%al
call   1040 <printf@plt>
cmp    $0x1f,%eax
jne    130c <main+0x1ec>
xor    %eax,%eax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%*c\0A\00"
@.str.1 = [5 x i8] c"%*d\0A\00"
@.str.2 = [6 x i8] c"%*ld\0A\00"
@.str.3 = [5 x i8] c"%*s\0A\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"asdfg\00"
@.str.6 = [10 x i8] c"asdfgasdf\00"
@.str.7 = [5 x i8] c"%*f\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5, i32 97)
%2 = icmp ne i32 %1, 6
br i1 %2, label %3, label %4
3: ; preds = %0
unreachable
4: ; preds = %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 1)
%6 = icmp ne i32 %5, 21
br i1 %6, label %7, label %8
7: ; preds = %4
unreachable
8: ; preds = %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 12312312)
%10 = icmp ne i32 %9, 21
br i1 %10, label %11, label %12
11: ; preds = %8
unreachable
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 2)
%14 = icmp ne i32 %13, 4
br i1 %14, label %15, label %16
15: ; preds = %12
unreachable
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 221)
%18 = icmp ne i32 %17, 4
br i1 %18, label %19, label %20
19: ; preds = %16
unreachable
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 -221)
%22 = icmp ne i32 %21, 5
br i1 %22, label %23, label %24
23: ; preds = %20
unreachable
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 5221)
%26 = icmp ne i32 %25, 5
br i1 %26, label %27, label %28
27: ; preds = %24
unreachable
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 5221)
%30 = icmp ne i32 %29, 5
br i1 %30, label %31, label %32
31: ; preds = %28
unreachable
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3, i64 221)
%34 = icmp ne i32 %33, 4
br i1 %34, label %35, label %36
35: ; preds = %32
unreachable
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3, i64 -221)
%38 = icmp ne i32 %37, 5
br i1 %38, label %39, label %40
39: ; preds = %36
unreachable
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3, i64 5221)
%42 = icmp ne i32 %41, 5
br i1 %42, label %43, label %44
43: ; preds = %40
unreachable
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp ne i32 %45, 6
br i1 %46, label %47, label %48
47: ; preds = %44
unreachable
48: ; preds = %44
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp ne i32 %49, 6
br i1 %50, label %51, label %52
51: ; preds = %48
unreachable
52: ; preds = %48
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp ne i32 %53, 10
br i1 %54, label %55, label %56
55: ; preds = %52
unreachable
56: ; preds = %52
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 30, double 3.243240e+02)
%58 = icmp ne i32 %57, 31
br i1 %58, label %59, label %60
59: ; preds = %56
unreachable
60: ; preds = %56
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%*c\0A\00"
@.str.1 = [5 x i8] c"%*d\0A\00"
@.str.2 = [6 x i8] c"%*ld\0A\00"
@.str.3 = [5 x i8] c"%*s\0A\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"asdfg\00"
@.str.6 = [10 x i8] c"asdfgasdf\00"
@.str.7 = [5 x i8] c"%*f\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 5, i32 97)
%2 = icmp eq i32 %1, 6
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void @abort()
unreachable
4: ; preds = %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 1)
%6 = icmp eq i32 %5, 21
br i1 %6, label %8, label %7
7: ; preds = %4
tail call void @abort()
unreachable
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 12312312)
%10 = icmp eq i32 %9, 21
br i1 %10, label %12, label %11
11: ; preds = %8
tail call void @abort()
unreachable
12: ; preds = %8
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 2)
%14 = icmp eq i32 %13, 4
br i1 %14, label %16, label %15
15: ; preds = %12
tail call void @abort()
unreachable
16: ; preds = %12
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 221)
%18 = icmp eq i32 %17, 4
br i1 %18, label %20, label %19
19: ; preds = %16
tail call void @abort()
unreachable
20: ; preds = %16
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 -221)
%22 = icmp eq i32 %21, 5
br i1 %22, label %24, label %23
23: ; preds = %20
tail call void @abort()
unreachable
24: ; preds = %20
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 5221)
%26 = icmp eq i32 %25, 5
br i1 %26, label %28, label %27
27: ; preds = %24
tail call void @abort()
unreachable
28: ; preds = %24
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 5221)
%30 = icmp eq i32 %29, 5
br i1 %30, label %32, label %31
31: ; preds = %28
tail call void @abort()
unreachable
32: ; preds = %28
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3, i64 221)
%34 = icmp eq i32 %33, 4
br i1 %34, label %36, label %35
35: ; preds = %32
tail call void @abort()
unreachable
36: ; preds = %32
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3, i64 -221)
%38 = icmp eq i32 %37, 5
br i1 %38, label %40, label %39
39: ; preds = %36
tail call void @abort()
unreachable
40: ; preds = %36
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3, i64 5221)
%42 = icmp eq i32 %41, 5
br i1 %42, label %44, label %43
43: ; preds = %40
tail call void @abort()
unreachable
44: ; preds = %40
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp eq i32 %45, 6
br i1 %46, label %48, label %47
47: ; preds = %44
tail call void @abort()
unreachable
48: ; preds = %44
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp eq i32 %49, 6
br i1 %50, label %52, label %51
51: ; preds = %48
tail call void @abort()
unreachable
52: ; preds = %48
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp eq i32 %53, 10
br i1 %54, label %56, label %55
55: ; preds = %52
tail call void @abort()
unreachable
56: ; preds = %52
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 30, double 3.243240e+02)
%58 = icmp eq i32 %57, 31
br i1 %58, label %60, label %59
59: ; preds = %56
tail call void @abort()
unreachable
60: ; preds = %56
ret i32 0
}