#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*/ CT_ASSERT(int);
int /*<<< orphan*/ sscanf(char *, char *, ...);
void scanf_test() {
  long l = 0;
  int i = 0;
  short s = 0;
  char c = 0;
  unsigned long ul = 0;
  unsigned int ui = 0;
  unsigned short us = 0;
  unsigned char uc = 0;
  double d = 0.0;
  sscanf("10", "%d", &i);
  CT_ASSERT(i == 10);
  sscanf("+11", "%d", &i);
  CT_ASSERT(i == 11);
  sscanf("-10", "%d", &i);
  CT_ASSERT(i == -10);
  sscanf("10", "%o", &ui);
  CT_ASSERT(ui == 010);
  sscanf("-10", "%o", &ui);
  CT_ASSERT(ui == -010);
  sscanf("+11", "%o", &ui);
  CT_ASSERT(ui == 011);
  sscanf("af", "%x", &ui);
  CT_ASSERT(ui == 0xaf);
  sscanf("-af", "%X", &ui);
  CT_ASSERT(ui == -0xaf);
  sscanf("+fe", "%x", &ui);
  CT_ASSERT(ui == 0xfe);
  sscanf("AF", "%x", &ui);
  CT_ASSERT(ui == 0xaf);
  sscanf("-AF", "%X", &ui);
  CT_ASSERT(ui == -0xaf);
  sscanf("+FE", "%x", &ui);
  CT_ASSERT(ui == 0xfe);
  sscanf("%45", "%%%i", &i);
  CT_ASSERT(i == 45);
  sscanf("45.300000", "%lf", &d);
  CT_ASSERT(d == 45.3);
  sscanf("54.30", "%lf", &d);
  CT_ASSERT(d == 54.3);
  sscanf("5.43", "%lg", &d);
  CT_ASSERT(d == 5.43);
  sscanf("4.530000e+01", "%le", &d);
  CT_ASSERT(d == 45.3);
  sscanf("XXX  4.53e+02", "XXX%le", &d);
  CT_ASSERT(d == 453.0);
  sscanf("XXX  3.53e+01", "XXX%le", &d);
  CT_ASSERT(d == 35.3);
}


x86 assembly (clang, -O0):
<scanf_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movw   $0x0,-0xe(%rbp)
movb   $0x0,-0xf(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movw   $0x0,-0x1e(%rbp)
movb   $0x0,-0x1f(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xec7(%rip),%rdi
lea    0xeb8(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xa,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xe98(%rip),%rdi
lea    0xe8e(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xb,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xe72(%rip),%rdi
lea    0xe64(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xfffffff6,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xe49(%rip),%rdi
lea    0xe45(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0x8,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xe1e(%rip),%rdi
lea    0xe1b(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xfffffff8,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xdf0(%rip),%rdi
lea    0xdf1(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0x9,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xdd5(%rip),%rdi
lea    0xdca(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xaf,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xda7(%rip),%rdi
lea    0xda4(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xffffff51,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xd81(%rip),%rdi
lea    0xd70(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xfe,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xd59(%rip),%rdi
lea    0xd43(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xaf,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xd2b(%rip),%rdi
lea    0xd1d(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xffffff51,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xd02(%rip),%rdi
lea    0xce9(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0xfe,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xcd9(%rip),%rdi
lea    0xcd6(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
cmpl   $0x2d,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xcb8(%rip),%rdi
lea    0xcbb(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xc54(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xc8a(%rip),%rdi
lea    0xc7f(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xc28(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xc54(%rip),%rdi
lea    0xc52(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xbe4(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xc21(%rip),%rdi
lea    0xc38(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xba0(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xbf2(%rip),%rdi
lea    0xbf9(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xb5c(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
lea    0xbcb(%rip),%rdi
lea    0xbbd(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xb18(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <CT_ASSERT@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanf_test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xee2(%rip),%r12
lea    0xed3(%rip),%rbx
lea    0xc(%rsp),%r14
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xa,0xc(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xeaa(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xb,0xc(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xe87(%rip),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xfffffff6,0xc(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xe64(%rip),%rbp
lea    0x8(%rsp),%rbx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0x8,0x8(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xfffffff8,0x8(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0x9,0x8(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xdff(%rip),%rdi
lea    0xdf4(%rip),%r15
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xaf,0x8(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xdd0(%rip),%rdi
lea    0xdcd(%rip),%r12
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xffffff51,0x8(%rsp)
ff
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xda9(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xfe,0x8(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xd87(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xaf,0x8(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xd5f(%rip),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xffffff51,0x8(%rsp)
ff
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xd3c(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0xfe,0x8(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xd19(%rip),%rdi
lea    0xd16(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0x2d,0xc(%rsp)
sete   %dil
call   1030 <CT_ASSERT@plt>
lea    0xcfa(%rip),%rdi
lea    0xcfd(%rip),%rbp
lea    0x10(%rsp),%rbx
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
movsd  0x10(%rsp),%xmm0
cmpeqsd 0xc7d(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <CT_ASSERT@plt>
lea    0xccc(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
movsd  0xc5c(%rip),%xmm0
cmpeqsd 0x10(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <CT_ASSERT@plt>
lea    0xca2(%rip),%rdi
lea    0xca0(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
movsd  0xc30(%rip),%xmm0
cmpeqsd 0x10(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <CT_ASSERT@plt>
lea    0xc77(%rip),%rdi
lea    0xc8e(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
movsd  0xbec(%rip),%xmm0
cmpeqsd 0x10(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <CT_ASSERT@plt>
lea    0xc50(%rip),%rdi
lea    0xc57(%rip),%rbp
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
movsd  0xbcd(%rip),%xmm0
cmpeqsd 0x10(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <CT_ASSERT@plt>
lea    0xc2e(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
movsd  0xba5(%rip),%xmm0
cmpeqsd 0x10(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <CT_ASSERT@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"10\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"+11\00"
@.str.3 = [4 x i8] c"-10\00"
@.str.4 = [3 x i8] c"%o\00"
@.str.5 = [3 x i8] c"af\00"
@.str.6 = [3 x i8] c"%x\00"
@.str.7 = [4 x i8] c"-af\00"
@.str.8 = [3 x i8] c"%X\00"
@.str.9 = [4 x i8] c"+fe\00"
@.str.10 = [3 x i8] c"AF\00"
@.str.11 = [4 x i8] c"-AF\00"
@.str.12 = [4 x i8] c"+FE\00"
@.str.13 = [4 x i8] c"%45\00"
@.str.14 = [5 x i8] c"%%%i\00"
@.str.15 = [10 x i8] c"45.300000\00"
@.str.16 = [4 x i8] c"%lf\00"
@.str.17 = [6 x i8] c"54.30\00"
@.str.18 = [5 x i8] c"5.43\00"
@.str.19 = [4 x i8] c"%lg\00"
@.str.20 = [13 x i8] c"4.530000e+01\00"
@.str.21 = [4 x i8] c"%le\00"
@.str.22 = [14 x i8] c"XXX 4.53e+02\00"
@.str.23 = [7 x i8] c"XXX%le\00"
@.str.24 = [14 x i8] c"XXX 3.53e+01\00"
define void @scanf_test() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i16
%4 = alloca i8
%5 = alloca i64
%6 = alloca i32
%7 = alloca i16
%8 = alloca i8
%9 = alloca double
store i64 0, i64* %1
store i32 0, i32* %2
store i16 0, i16* %3
store i8 0, i8* %4
store i64 0, i64* %5
store i32 0, i32* %6
store i16 0, i16* %7
store i8 0, i8* %8
store double 0.000000e+00, double* %9
%10 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
%13 = zext i1 %12 to i32
%14 = call i32 @CT_ASSERT(i32 %13)
%15 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 11
%18 = zext i1 %17 to i32
%19 = call i32 @CT_ASSERT(i32 %18)
%20 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, -10
%23 = zext i1 %22 to i32
%24 = call i32 @CT_ASSERT(i32 %23)
%25 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 8
%28 = zext i1 %27 to i32
%29 = call i32 @CT_ASSERT(i32 %28)
%30 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%31 = load i32, i32* %6
%32 = icmp eq i32 %31, -8
%33 = zext i1 %32 to i32
%34 = call i32 @CT_ASSERT(i32 %33)
%35 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%36 = load i32, i32* %6
%37 = icmp eq i32 %36, 9
%38 = zext i1 %37 to i32
%39 = call i32 @CT_ASSERT(i32 %38)
%40 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %6)
%41 = load i32, i32* %6
%42 = icmp eq i32 %41, 175
%43 = zext i1 %42 to i32
%44 = call i32 @CT_ASSERT(i32 %43)
%45 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %6)
%46 = load i32, i32* %6
%47 = icmp eq i32 %46, -175
%48 = zext i1 %47 to i32
%49 = call i32 @CT_ASSERT(i32 %48)
%50 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %6)
%51 = load i32, i32* %6
%52 = icmp eq i32 %51, 254
%53 = zext i1 %52 to i32
%54 = call i32 @CT_ASSERT(i32 %53)
%55 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %6)
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, 175
%58 = zext i1 %57 to i32
%59 = call i32 @CT_ASSERT(i32 %58)
%60 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %6)
%61 = load i32, i32* %6
%62 = icmp eq i32 %61, -175
%63 = zext i1 %62 to i32
%64 = call i32 @CT_ASSERT(i32 %63)
%65 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %6)
%66 = load i32, i32* %6
%67 = icmp eq i32 %66, 254
%68 = zext i1 %67 to i32
%69 = call i32 @CT_ASSERT(i32 %68)
%70 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32* %2)
%71 = load i32, i32* %2
%72 = icmp eq i32 %71, 45
%73 = zext i1 %72 to i32
%74 = call i32 @CT_ASSERT(i32 %73)
%75 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), double* %9)
%76 = load double, double* %9
%77 = fcmp oeq double %76, 4.530000e+01
%78 = zext i1 %77 to i32
%79 = call i32 @CT_ASSERT(i32 %78)
%80 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), double* %9)
%81 = load double, double* %9
%82 = fcmp oeq double %81, 5.430000e+01
%83 = zext i1 %82 to i32
%84 = call i32 @CT_ASSERT(i32 %83)
%85 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double* %9)
%86 = load double, double* %9
%87 = fcmp oeq double %86, 5.430000e+00
%88 = zext i1 %87 to i32
%89 = call i32 @CT_ASSERT(i32 %88)
%90 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), double* %9)
%91 = load double, double* %9
%92 = fcmp oeq double %91, 4.530000e+01
%93 = zext i1 %92 to i32
%94 = call i32 @CT_ASSERT(i32 %93)
%95 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), double* %9)
%96 = load double, double* %9
%97 = fcmp oeq double %96, 4.530000e+02
%98 = zext i1 %97 to i32
%99 = call i32 @CT_ASSERT(i32 %98)
%100 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), double* %9)
%101 = load double, double* %9
%102 = fcmp oeq double %101, 3.530000e+01
%103 = zext i1 %102 to i32
%104 = call i32 @CT_ASSERT(i32 %103)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"10\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"+11\00"
@.str.3 = [4 x i8] c"-10\00"
@.str.4 = [3 x i8] c"%o\00"
@.str.5 = [3 x i8] c"af\00"
@.str.6 = [3 x i8] c"%x\00"
@.str.7 = [4 x i8] c"-af\00"
@.str.8 = [3 x i8] c"%X\00"
@.str.9 = [4 x i8] c"+fe\00"
@.str.10 = [3 x i8] c"AF\00"
@.str.11 = [4 x i8] c"-AF\00"
@.str.12 = [4 x i8] c"+FE\00"
@.str.13 = [4 x i8] c"%45\00"
@.str.14 = [5 x i8] c"%%%i\00"
@.str.15 = [10 x i8] c"45.300000\00"
@.str.16 = [4 x i8] c"%lf\00"
@.str.17 = [6 x i8] c"54.30\00"
@.str.18 = [5 x i8] c"5.43\00"
@.str.19 = [4 x i8] c"%lg\00"
@.str.20 = [13 x i8] c"4.530000e+01\00"
@.str.21 = [4 x i8] c"%le\00"
@.str.22 = [14 x i8] c"XXX 4.53e+02\00"
@.str.23 = [7 x i8] c"XXX%le\00"
@.str.24 = [14 x i8] c"XXX 3.53e+01\00"
define void @scanf_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%7 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 10
%10 = zext i1 %9 to i32
%11 = call i32 @CT_ASSERT(i32 %10)
%12 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 11
%15 = zext i1 %14 to i32
%16 = call i32 @CT_ASSERT(i32 %15)
%17 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = icmp eq i32 %18, -10
%20 = zext i1 %19 to i32
%21 = call i32 @CT_ASSERT(i32 %20)
%22 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 8
%25 = zext i1 %24 to i32
%26 = call i32 @CT_ASSERT(i32 %25)
%27 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, -8
%30 = zext i1 %29 to i32
%31 = call i32 @CT_ASSERT(i32 %30)
%32 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%33 = load i32, i32* %2
%34 = icmp eq i32 %33, 9
%35 = zext i1 %34 to i32
%36 = call i32 @CT_ASSERT(i32 %35)
%37 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%38 = load i32, i32* %2
%39 = icmp eq i32 %38, 175
%40 = zext i1 %39 to i32
%41 = call i32 @CT_ASSERT(i32 %40)
%42 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%43 = load i32, i32* %2
%44 = icmp eq i32 %43, -175
%45 = zext i1 %44 to i32
%46 = call i32 @CT_ASSERT(i32 %45)
%47 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 254
%50 = zext i1 %49 to i32
%51 = call i32 @CT_ASSERT(i32 %50)
%52 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%53 = load i32, i32* %2
%54 = icmp eq i32 %53, 175
%55 = zext i1 %54 to i32
%56 = call i32 @CT_ASSERT(i32 %55)
%57 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%58 = load i32, i32* %2
%59 = icmp eq i32 %58, -175
%60 = zext i1 %59 to i32
%61 = call i32 @CT_ASSERT(i32 %60)
%62 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%63 = load i32, i32* %2
%64 = icmp eq i32 %63, 254
%65 = zext i1 %64 to i32
%66 = call i32 @CT_ASSERT(i32 %65)
%67 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32* %1)
%68 = load i32, i32* %1
%69 = icmp eq i32 %68, 45
%70 = zext i1 %69 to i32
%71 = call i32 @CT_ASSERT(i32 %70)
%72 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), double* %3)
%73 = load double, double* %3
%74 = fcmp oeq double %73, 4.530000e+01
%75 = zext i1 %74 to i32
%76 = call i32 @CT_ASSERT(i32 %75)
%77 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), double* %3)
%78 = load double, double* %3
%79 = fcmp oeq double %78, 5.430000e+01
%80 = zext i1 %79 to i32
%81 = call i32 @CT_ASSERT(i32 %80)
%82 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), double* %3)
%83 = load double, double* %3
%84 = fcmp oeq double %83, 5.430000e+00
%85 = zext i1 %84 to i32
%86 = call i32 @CT_ASSERT(i32 %85)
%87 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), double* %3)
%88 = load double, double* %3
%89 = fcmp oeq double %88, 4.530000e+01
%90 = zext i1 %89 to i32
%91 = call i32 @CT_ASSERT(i32 %90)
%92 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), double* %3)
%93 = load double, double* %3
%94 = fcmp oeq double %93, 4.530000e+02
%95 = zext i1 %94 to i32
%96 = call i32 @CT_ASSERT(i32 %95)
%97 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), double* %3)
%98 = load double, double* %3
%99 = fcmp oeq double %98, 3.530000e+01
%100 = zext i1 %99 to i32
%101 = call i32 @CT_ASSERT(i32 %100)
ret void
}