void test(void) {
  printf("%jd", 42.0);
  printf("%ju", 42.0);
  printf("%zu", 42.0);
  printf("%td", 42.0);
  printf("%lc", 42.0);
  printf("%ls", 42.0);
  printf("%S", 42.0);
  printf("%C", 42.0);
  scanf("%jd", 0);
  scanf("%ju", 0);
  scanf("%zu", 0);
  scanf("%td", 0);
  scanf("%lc", 0);
  scanf("%ls", 0);
  scanf("%S", 0);
  scanf("%C", 0);
  typedef void *size_t;
  typedef void *intmax_t;
  typedef void *uintmax_t;
  typedef void *ptrdiff_t;
  printf("%jd", (intmax_t)42);
  printf("%ju", (uintmax_t)42);
  printf("%zu", (size_t)42);
  printf("%td", (ptrdiff_t)42);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
lea    0xedd(%rip),%rdi
movsd  0xecd(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
movsd  0xeb7(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
movsd  0xea1(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
movsd  0xe8b(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
movsd  0xe75(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
movsd  0xe5f(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
movsd  0xe49(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
movsd  0xe33(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe2d(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe21(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe15(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe09(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xdfd(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xdf1(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xde5(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xdd8(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xdad(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd9e(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd8f(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd80(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
movsd  0xec6(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
movsd  0xeb0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%r12
mov    %r12,%rdi
movsd  0xe97(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%r13
mov    %r13,%rdi
movsd  0xe7e(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe88(%rip),%rbx
mov    %rbx,%rdi
movsd  0xe65(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe73(%rip),%rbp
mov    %rbp,%rdi
movsd  0xe4c(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe5e(%rip),%r14
mov    %r14,%rdi
movsd  0xe33(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe48(%rip),%r15
mov    %r15,%rdi
movsd  0xe1a(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe14(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe08(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r12,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r13,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbp,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r15,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    $0x2a,%esi
lea    0xda7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2a,%esi
lea    0xd98(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2a,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2a,%esi
mov    %r13,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%jd\00"
@.str.1 = [4 x i8] c"%ju\00"
@.str.2 = [4 x i8] c"%zu\00"
@.str.3 = [4 x i8] c"%td\00"
@.str.4 = [4 x i8] c"%lc\00"
@.str.5 = [4 x i8] c"%ls\00"
@.str.6 = [3 x i8] c"%S\00"
@.str.7 = [3 x i8] c"%C\00"
define void @test() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 4.200000e+01)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double 4.200000e+01)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double 4.200000e+01)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double 4.200000e+01)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 4.200000e+01)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double 4.200000e+01)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), double 4.200000e+01)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), double 4.200000e+01)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 0)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 0)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 0)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 0)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%jd\00"
@.str.1 = [4 x i8] c"%ju\00"
@.str.2 = [4 x i8] c"%zu\00"
@.str.3 = [4 x i8] c"%td\00"
@.str.4 = [4 x i8] c"%lc\00"
@.str.5 = [4 x i8] c"%ls\00"
@.str.6 = [3 x i8] c"%S\00"
@.str.7 = [3 x i8] c"%C\00"
define void @test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 4.200000e+01)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double 4.200000e+01)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double 4.200000e+01)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double 4.200000e+01)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 4.200000e+01)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double 4.200000e+01)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), double 4.200000e+01)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), double 4.200000e+01)
%9 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%10 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%11 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
%12 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
%13 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 0)
%14 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 0)
%15 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 0)
%16 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 0)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* inttoptr (i64 42 to i8*))
ret void
}