#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sprintf(char *, char *, int, double, char *, int);
int sscanf(char *, char *, int *, ...);
int main(int argc, char *argv[]) {
  int ret = 0;
  char buf[1024] = {0};
  sprintf(buf, "%d %.8f %s %d\n", 12, 3.1415, "nihao", 42);
  double f = 0.0;
  int n = 0, m = 0;
  int pos1 = 0, pos2 = 0;
  char str[128] = {0};
  ret = sscanf(buf, "%d %lf %n%s %n%d\n", &n, &f, &pos1, str, &pos2, &m);
  printf("buf (%d) : \n%s", ret, buf);
  printf("%d %.8lf [%d]%5s [%d]%d\n", n, f, pos1, str, pos2, m);
  n = m = 0;
  pos1 = pos2 = 0;
  memset(str, 0, 128);
  ret = sscanf(buf, "%d %*f %n%s %n%d\n", &n, &pos1, str, &pos2, &m);
  printf("buf (%d) : \n%s", ret, buf);
  printf("%d [%d]%5s [%d]%d\n", n, pos1, str, pos2, m);
  n = m = 0;
  pos1 = pos2 = 0;
  memset(str, 0, 128);
  ret = sscanf(buf, "%d %lf %n%[a-zA-Z0-9] %n%d\n", &n, &f, &pos1, str, &pos2,
               &m);
  printf("buf (%d) : \n%s", ret, buf);
  printf("%d %.8lf [%d]%5s [%d]%d\n", n, f, pos1, str, pos2, m);
  n = m = 0;
  pos1 = pos2 = 0;
  memset(str, 0, 128);
  ret = sscanf(buf, "%3$d %5$lf %1$n%6$[a-zA-Z0-9] %2$n%4$d\n", &pos1, &pos2,
               &n, &m, &f, str);
  printf("buf (%d) : \n%s", ret, buf);
  printf("%d %.8lf [%d]%5s [%d]%d\n", n, f, pos1, str, pos2, m);
  n = m = 0;
  pos1 = pos2 = 0;
  memset(str, 0, 128);
  ret = sscanf(buf, "%3$d %5$lf %1$n%6$[a-zA-Z0-9] %2$n%4$d\n", &pos1, &pos2,
               &n, &m, &f, str);
  printf("buf (%d) : \n%s", ret, buf);
  printf("%d %.8lf [%d]%5s [%d]%d\n", n, f, pos1, str, pos2, m);
  n = m = pos1 = pos2 = 0;
  ret = sscanf("0x123 0123 123", "%i %i %i", &n, &m, &pos1);
  printf("%d: %#x %#o %#d\n", ret, n, m, pos1);
  n = m = pos1 = pos2 = 0;
  ret = sscanf("0x123 0123 123", "%d %d %d", &n, &m, &pos1);
  printf("%d: %#x %#o %#d\n", ret, n, m, pos1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
lea    0xe87(%rip),%rsi
mov    $0xc,%edx
movsd  0xe72(%rip),%xmm0
lea    0xe82(%rip),%rcx
mov    $0x2a,%r8d
call   1060 <sprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x428(%rbp)
ff
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x430(%rbp)
movl   $0x0,-0x434(%rbp)
movl   $0x0,-0x438(%rbp)
lea    -0x4c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
lea    -0x4c0(%rbp),%r9
lea    0xe22(%rip),%rsi
lea    -0x42c(%rbp),%rdx
lea    -0x428(%rbp),%rcx
lea    -0x434(%rbp),%r8
lea    -0x438(%rbp),%r10
lea    -0x430(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x42c(%rbp),%esi
movsd  -0x428(%rbp),%xmm0
ff
mov    -0x434(%rbp),%edx
lea    -0x4c0(%rbp),%rcx
mov    -0x438(%rbp),%r8d
mov    -0x430(%rbp),%r9d
lea    0xdc5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x430(%rbp)
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
lea    -0x4c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
lea    -0x4c0(%rbp),%r8
lea    0xd87(%rip),%rsi
lea    -0x42c(%rbp),%rdx
lea    -0x434(%rbp),%rcx
lea    -0x438(%rbp),%r9
lea    -0x430(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x42c(%rbp),%esi
mov    -0x434(%rbp),%edx
lea    -0x4c0(%rbp),%rcx
mov    -0x438(%rbp),%r8d
mov    -0x430(%rbp),%r9d
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x430(%rbp)
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
lea    -0x4c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
lea    -0x4c0(%rbp),%r9
lea    0xceb(%rip),%rsi
lea    -0x42c(%rbp),%rdx
lea    -0x428(%rbp),%rcx
lea    -0x434(%rbp),%r8
lea    -0x438(%rbp),%r10
lea    -0x430(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x42c(%rbp),%esi
movsd  -0x428(%rbp),%xmm0
ff
mov    -0x434(%rbp),%edx
lea    -0x4c0(%rbp),%rcx
mov    -0x438(%rbp),%r8d
mov    -0x430(%rbp),%r9d
lea    0xc2f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x430(%rbp)
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
lea    -0x4c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
lea    -0x4c0(%rbp),%rax
lea    0xc32(%rip),%rsi
lea    -0x434(%rbp),%rdx
lea    -0x438(%rbp),%rcx
lea    -0x42c(%rbp),%r8
lea    -0x430(%rbp),%r9
lea    -0x428(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x42c(%rbp),%esi
movsd  -0x428(%rbp),%xmm0
ff
mov    -0x434(%rbp),%edx
lea    -0x4c0(%rbp),%rcx
mov    -0x438(%rbp),%r8d
mov    -0x430(%rbp),%r9d
lea    0xb5a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x430(%rbp)
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
lea    -0x4c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
lea    -0x4c0(%rbp),%rax
lea    0xb5d(%rip),%rsi
lea    -0x434(%rbp),%rdx
lea    -0x438(%rbp),%rcx
lea    -0x42c(%rbp),%r8
lea    -0x430(%rbp),%r9
lea    -0x428(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xaad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x42c(%rbp),%esi
movsd  -0x428(%rbp),%xmm0
ff
mov    -0x434(%rbp),%edx
lea    -0x4c0(%rbp),%rcx
mov    -0x438(%rbp),%r8d
mov    -0x430(%rbp),%r9d
lea    0xa85(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
movl   $0x0,-0x430(%rbp)
movl   $0x0,-0x42c(%rbp)
lea    0xad1(%rip),%rdi
lea    0xad9(%rip),%rsi
lea    -0x42c(%rbp),%rdx
lea    -0x430(%rbp),%rcx
lea    -0x434(%rbp),%r8
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x42c(%rbp),%edx
mov    -0x430(%rbp),%ecx
mov    -0x434(%rbp),%r8d
lea    0xaa6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
movl   $0x0,-0x430(%rbp)
movl   $0x0,-0x42c(%rbp)
lea    0xa58(%rip),%rdi
lea    0xa7a(%rip),%rsi
lea    -0x42c(%rbp),%rdx
lea    -0x430(%rbp),%rcx
lea    -0x434(%rbp),%r8
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x42c(%rbp),%edx
mov    -0x430(%rbp),%ecx
mov    -0x434(%rbp),%r8d
lea    0xa2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4a8,%rsp
lea    0xa0(%rsp),%r13
mov    $0x400,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xe99(%rip),%rsi
lea    0xea1(%rip),%rcx
movsd  0xe82(%rip),%xmm0
mov    %r13,%rdi
mov    $0xc,%edx
mov    $0x2a,%r8d
call   1060 <sprintf@plt>
movq   $0x0,0x18(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
lea    0xc(%rsp),%rbp
lea    0x10(%rsp),%r15
lea    0xe21(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r14
lea    0x20(%rsp),%r12
mov    %r13,%rdi
mov    %r14,%r8
mov    %r12,%r9
xor    %eax,%eax
push   %rbp
push   %r15
call   1050 <sscanf@plt>
add    $0x10,%rsp
lea    0xe01(%rip),%rdi
mov    %eax,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
movsd  0x18(%rsp),%xmm0
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xde5(%rip),%rdi
mov    %r12,%rcx
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
sub    $0x8,%rsp
lea    0xdba(%rip),%rsi
mov    %r13,%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r12,%r8
mov    %r15,%r9
xor    %eax,%eax
push   %rbp
call   1050 <sscanf@plt>
add    $0x10,%rsp
lea    0xd6b(%rip),%rdi
mov    %eax,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xd80(%rip),%rdi
mov    %r12,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    0xd53(%rip),%rsi
mov    %r13,%rdi
mov    %rbx,%rdx
lea    0x18(%rsp),%rbx
mov    %rbx,%rcx
mov    %r14,%r8
mov    %r14,%r15
mov    %r12,%r9
xor    %eax,%eax
push   %rbp
lea    0x18(%rsp),%r14
push   %r14
call   1050 <sscanf@plt>
add    $0x10,%rsp
lea    0xcd5(%rip),%rdi
mov    %eax,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
movsd  0x18(%rsp),%xmm0
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xcb9(%rip),%rbp
mov    %rbp,%rdi
mov    %r12,%rcx
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    0xcd0(%rip),%rsi
mov    %r13,%rdi
mov    %r15,%rdx
mov    %r14,%rcx
lea    0x8(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %r9,%r14
xor    %eax,%eax
push   %r12
push   %rbx
call   1050 <sscanf@plt>
add    $0x10,%rsp
lea    0xc3c(%rip),%rdi
mov    %eax,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
movsd  0x18(%rsp),%xmm0
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
mov    %rbp,%rdi
mov    %r12,%rcx
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
mov    %r13,%rdi
lea    0xc3b(%rip),%rsi
mov    %r15,%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %r8,%rbp
mov    %r14,%r9
xor    %eax,%eax
push   %r12
push   %rbx
call   1050 <sscanf@plt>
add    $0x10,%rsp
lea    0xbaa(%rip),%rdi
mov    %eax,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
movsd  0x18(%rsp),%xmm0
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xb8e(%rip),%rdi
mov    %r12,%rcx
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xbdf(%rip),%rbx
lea    0xbe7(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %rbp,%r12
mov    %r14,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x14(%rsp),%r8d
lea    0xbc6(%rip),%rbp
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xba4(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x4a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d %.8f %s %d\0A\00"
@.str.1 = [6 x i8] c"nihao\00"
@.str.2 = [18 x i8] c"%d %lf %n%s %n%d\0A\00"
@.str.3 = [15 x i8] c"buf (%d) : \0A%s\00"
@.str.4 = [25 x i8] c"%d %.8lf [%d]%5s [%d]%d\0A\00"
@.str.5 = [18 x i8] c"%d %*f %n%s %n%d\0A\00"
@.str.6 = [19 x i8] c"%d [%d]%5s [%d]%d\0A\00"
@.str.7 = [28 x i8] c"%d %lf %n%[a-zA-Z0-9] %n%d\0A\00"
@.str.8 = [40 x i8] c"%3$d %5$lf %1$n%6$[a-zA-Z0-9] %2$n%4$d\0A\00"
@.str.9 = [15 x i8] c"0x123 0123 123\00"
@.str.10 = [9 x i8] c"%i %i %i\00"
@.str.11 = [17 x i8] c"%d: %#x %#o %#d\0A\00"
@.str.12 = [9 x i8] c"%d %d %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1024 x i8]
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%14 = bitcast [1024 x i8]* %7 to i8*
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12, double 3.141500e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 42)
store double 0.000000e+00, double* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
%17 = bitcast [128 x i8]* %13 to i8*
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%20 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32* %9, double* %8, i32* %11, i8* %19, i32* %12, i32* %10)
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %21, i8* %22)
%24 = load i32, i32* %9
%25 = load double, double* %8
%26 = load i32, i32* %11
%27 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%28 = load i32, i32* %12
%29 = load i32, i32* %10
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %24, double %25, i32 %26, i8* %27, i32 %28, i32 %29)
store i32 0, i32* %10
store i32 0, i32* %9
store i32 0, i32* %12
store i32 0, i32* %11
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%32 = call i32 @memset(i8* %31, i32 0, i32 128)
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%35 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32* %9, i32* %11, i8* %34, i32* %12, i32* %10)
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %36, i8* %37)
%39 = load i32, i32* %9
%40 = load i32, i32* %11
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%42 = load i32, i32* %12
%43 = load i32, i32* %10
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %39, i32 %40, i8* %41, i32 %42, i32 %43)
store i32 0, i32* %10
store i32 0, i32* %9
store i32 0, i32* %12
store i32 0, i32* %11
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%46 = call i32 @memset(i8* %45, i32 0, i32 128)
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%49 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %47, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32* %9, double* %8, i32* %11, i8* %48, i32* %12, i32* %10)
store i32 %49, i32* %6
%50 = load i32, i32* %6
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %50, i8* %51)
%53 = load i32, i32* %9
%54 = load double, double* %8
%55 = load i32, i32* %11
%56 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%57 = load i32, i32* %12
%58 = load i32, i32* %10
%59 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %53, double %54, i32 %55, i8* %56, i32 %57, i32 %58)
store i32 0, i32* %10
store i32 0, i32* %9
store i32 0, i32* %12
store i32 0, i32* %11
%60 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%61 = call i32 @memset(i8* %60, i32 0, i32 128)
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%63 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%64 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %62, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32* %11, i32* %12, i32* %9, i32* %10, double* %8, i8* %63)
store i32 %64, i32* %6
%65 = load i32, i32* %6
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%67 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %65, i8* %66)
%68 = load i32, i32* %9
%69 = load double, double* %8
%70 = load i32, i32* %11
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%72 = load i32, i32* %12
%73 = load i32, i32* %10
%74 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %68, double %69, i32 %70, i8* %71, i32 %72, i32 %73)
store i32 0, i32* %10
store i32 0, i32* %9
store i32 0, i32* %12
store i32 0, i32* %11
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%76 = call i32 @memset(i8* %75, i32 0, i32 128)
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%79 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %77, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32* %11, i32* %12, i32* %9, i32* %10, double* %8, i8* %78)
store i32 %79, i32* %6
%80 = load i32, i32* %6
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%82 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %80, i8* %81)
%83 = load i32, i32* %9
%84 = load double, double* %8
%85 = load i32, i32* %11
%86 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%87 = load i32, i32* %12
%88 = load i32, i32* %10
%89 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %83, double %84, i32 %85, i8* %86, i32 %87, i32 %88)
store i32 0, i32* %12
store i32 0, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%90 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
store i32 %90, i32* %6
%91 = load i32, i32* %6
%92 = load i32, i32* %9
%93 = load i32, i32* %10
%94 = load i32, i32* %11
%95 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %91, i32 %92, i32 %93, i32 %94)
store i32 0, i32* %12
store i32 0, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%96 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
store i32 %96, i32* %6
%97 = load i32, i32* %6
%98 = load i32, i32* %9
%99 = load i32, i32* %10
%100 = load i32, i32* %11
%101 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %97, i32 %98, i32 %99, i32 %100)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d %.8f %s %d\0A\00"
@.str.1 = [6 x i8] c"nihao\00"
@.str.2 = [18 x i8] c"%d %lf %n%s %n%d\0A\00"
@.str.3 = [15 x i8] c"buf (%d) : \0A%s\00"
@.str.4 = [25 x i8] c"%d %.8lf [%d]%5s [%d]%d\0A\00"
@.str.5 = [18 x i8] c"%d %*f %n%s %n%d\0A\00"
@.str.6 = [19 x i8] c"%d [%d]%5s [%d]%d\0A\00"
@.str.7 = [28 x i8] c"%d %lf %n%[a-zA-Z0-9] %n%d\0A\00"
@.str.8 = [40 x i8] c"%3$d %5$lf %1$n%6$[a-zA-Z0-9] %2$n%4$d\0A\00"
@.str.9 = [15 x i8] c"0x123 0123 123\00"
@.str.10 = [9 x i8] c"%i %i %i\00"
@.str.11 = [17 x i8] c"%d: %#x %#o %#d\0A\00"
@.str.12 = [9 x i8] c"%d %d %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [128 x i8]
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12, double 3.141500e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 42)
%12 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%13 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%14 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%15 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%16 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%18 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32* %5, double* %4, i32* %7, i8* %17, i32* %8, i32* %6)
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %18, i8* %10)
%20 = load i32, i32* %5
%21 = load double, double* %4
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = load i32, i32* %6
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %20, double %21, i32 %22, i8* %17, i32 %23, i32 %24)
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %8
store i32 0, i32* %7
%26 = call i32 @memset(i8* %17, i32 0, i32 128)
%27 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32* %5, i32* %7, i8* %17, i32* %8, i32* %6)
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %27, i8* %10)
%29 = load i32, i32* %5
%30 = load i32, i32* %7
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %29, i32 %30, i8* %17, i32 %31, i32 %32)
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %8
store i32 0, i32* %7
%34 = call i32 @memset(i8* %17, i32 0, i32 128)
%35 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32* %5, double* %4, i32* %7, i8* %17, i32* %8, i32* %6)
%36 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %35, i8* %10)
%37 = load i32, i32* %5
%38 = load double, double* %4
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = load i32, i32* %6
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %37, double %38, i32 %39, i8* %17, i32 %40, i32 %41)
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %8
store i32 0, i32* %7
%43 = call i32 @memset(i8* %17, i32 0, i32 128)
%44 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32* %7, i32* %8, i32* %5, i32* %6, double* %4, i8* %17)
%45 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %44, i8* %10)
%46 = load i32, i32* %5
%47 = load double, double* %4
%48 = load i32, i32* %7
%49 = load i32, i32* %8
%50 = load i32, i32* %6
%51 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %46, double %47, i32 %48, i8* %17, i32 %49, i32 %50)
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %8
store i32 0, i32* %7
%52 = call i32 @memset(i8* %17, i32 0, i32 128)
%53 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32* %7, i32* %8, i32* %5, i32* %6, double* %4, i8* %17)
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %53, i8* %10)
%55 = load i32, i32* %5
%56 = load double, double* %4
%57 = load i32, i32* %7
%58 = load i32, i32* %8
%59 = load i32, i32* %6
%60 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %55, double %56, i32 %57, i8* %17, i32 %58, i32 %59)
store i32 0, i32* %8
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
%61 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%62 = load i32, i32* %5
%63 = load i32, i32* %6
%64 = load i32, i32* %7
%65 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %61, i32 %62, i32 %63, i32 %64)
store i32 0, i32* %8
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
%66 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%67 = load i32, i32* %5
%68 = load i32, i32* %6
%69 = load i32, i32* %7
%70 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %66, i32 %67, i32 %68, i32 %69)
ret i32 0
}