#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 /*<<< orphan*/ scanf(char *, ...);
void f(void) {
  char *cp;
  printf("%qd", (long long)42);
  scanf("%qd", (long long *)0);
  scanf("%ms", &cp);
  printf("%S", L"foo");
  printf("%C", L'x');
  printf("%Li", (long long)42);
  printf("%Lo", (long long)42);
  printf("%Lu", (long long)42);
  printf("%Lx", (long long)42);
  printf("%LX", (long long)42);
  printf("%1$d", 42);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea2(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x78,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe62(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe44(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe35(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
mov    $0x2a,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea7(%rip),%rdi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe58(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe49(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%qd\00"
@.str.1 = [4 x i8] c"%ms\00"
@.str.2 = [3 x i8] c"%S\00"
@.str.3 = [4 x i32] [i32 102, i32 111, i32 111, i32 0]
@.str.4 = [3 x i8] c"%C\00"
@.str.5 = [4 x i8] c"%Li\00"
@.str.6 = [4 x i8] c"%Lo\00"
@.str.7 = [4 x i8] c"%Lu\00"
@.str.8 = [4 x i8] c"%Lx\00"
@.str.9 = [4 x i8] c"%LX\00"
@.str.10 = [5 x i8] c"%1$d\00"
define void @f() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 42)
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* null)
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* getelementptr inbounds ([4 x i32], [4 x i32]* @.str.3, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 120)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 42)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i64 42)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64 42)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i64 42)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64 42)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 42)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%qd\00"
@.str.1 = [4 x i8] c"%ms\00"
@.str.2 = [3 x i8] c"%S\00"
@.str.3 = [4 x i32] [i32 102, i32 111, i32 111, i32 0]
@.str.4 = [3 x i8] c"%C\00"
@.str.5 = [4 x i8] c"%Li\00"
@.str.6 = [4 x i8] c"%Lo\00"
@.str.7 = [4 x i8] c"%Lu\00"
@.str.8 = [4 x i8] c"%Lx\00"
@.str.9 = [4 x i8] c"%LX\00"
@.str.10 = [5 x i8] c"%1$d\00"
define void @f() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 42)
%4 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* null)
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* getelementptr inbounds ([4 x i32], [4 x i32]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 120)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 42)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i64 42)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64 42)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i64 42)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64 42)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 42)
ret void
}