#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 *, char *, int);
int sscanf(char *, char *, ...);
int test_sscanf(void) {
  int val = 0, val2 = 0;
  char ch = 0;
  do {
    if (!(1 == sscanf("1", "%d", &val))) {
      printf("expression '%s' untrue at %d\n",
             "1 == sscanf(\"1\", \"%d\", &val)", 190);
      return 0;
    }
  } while (0);
  do {
    if (!(val == 1)) {
      printf("expression '%s' untrue at %d\n", "val == 1", 191);
      return 0;
    }
  } while (0);
  do {
    if (!(2 == sscanf("32", "%1d%1d", &val, &val2))) {
      printf("expression '%s' untrue at %d\n",
             "2 == sscanf(\"32\", \"%1d%1d\", &val, &val2)", 193);
      return 0;
    }
  } while (0);
  do {
    if (!(val == 3)) {
      printf("expression '%s' untrue at %d\n", "val == 3", 194);
      return 0;
    }
  } while (0);
  do {
    if (!(val2 == 2)) {
      printf("expression '%s' untrue at %d\n", "val2 == 2", 195);
      return 0;
    }
  } while (0);
  do {
    if (!(2 == sscanf("-32", "%2d%1d", &val, &val2))) {
      printf("expression '%s' untrue at %d\n",
             "2 == sscanf(\"-32\", \"%2d%1d\", &val, &val2)", 197);
      return 0;
    }
  } while (0);
  do {
    if (!(val == -3)) {
      printf("expression '%s' untrue at %d\n", "val == -3", 198);
      return 0;
    }
  } while (0);
  do {
    if (!(val2 == 2)) {
      printf("expression '%s' untrue at %d\n", "val2 == 2", 199);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == sscanf("-32", "%u", &val))) {
      printf("expression '%s' untrue at %d\n",
             "1 == sscanf(\"-32\", \"%u\", &val)", 201);
      return 0;
    }
  } while (0);
  do {
    if (!(val == -32)) {
      printf("expression '%s' untrue at %d\n", "val == -32", 202);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == sscanf("32", "%u", &val))) {
      printf("expression '%s' untrue at %d\n",
             "1 == sscanf(\"32\", \"%u\", &val)", 204);
      return 0;
    }
  } while (0);
  do {
    if (!(val == 32)) {
      printf("expression '%s' untrue at %d\n", "val == 32", 205);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == sscanf("64", "%2u", &val))) {
      printf("expression '%s' untrue at %d\n",
             "1 == sscanf(\"64\", \"%2u\", &val)", 207);
      return 0;
    }
  } while (0);
  do {
    if (!(val == 64)) {
      printf("expression '%s' untrue at %d\n", "val == 64", 208);
      return 0;
    }
  } while (0);
  do {
    if (!(1 == sscanf("6", "%c", &ch))) {
      printf("expression '%s' untrue at %d\n",
             "1 == sscanf(\"6\", \"%c\", &ch)", 210);
      return 0;
    }
  } while (0);
  do {
    if (!(ch == '6')) {
      printf("expression '%s' untrue at %d\n", "ch == '6'", 211);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_sscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
lea    0xf04(%rip),%rdi
lea    0xeb8(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1186 <test_sscanf+0x66>
lea    0xe9a(%rip),%rdi
lea    0xeb1(%rip),%rsi
mov    $0xbe,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    118b <test_sscanf+0x6b>
jmp    1190 <test_sscanf+0x70>
cmpl   $0x1,-0x8(%rbp)
je     11be <test_sscanf+0x9e>
lea    0xe62(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0xbf,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    11c3 <test_sscanf+0xa3>
jmp    11c8 <test_sscanf+0xa8>
lea    0xf48(%rip),%rdi
lea    0xe71(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     1218 <test_sscanf+0xf8>
lea    0xe08(%rip),%rdi
lea    0xe4c(%rip),%rsi
mov    $0xc1,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    121d <test_sscanf+0xfd>
jmp    1222 <test_sscanf+0x102>
cmpl   $0x3,-0x8(%rbp)
je     1250 <test_sscanf+0x130>
lea    0xdd0(%rip),%rdi
lea    0xe3d(%rip),%rsi
mov    $0xc2,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    1255 <test_sscanf+0x135>
jmp    125a <test_sscanf+0x13a>
cmpl   $0x2,-0xc(%rbp)
je     1288 <test_sscanf+0x168>
lea    0xd98(%rip),%rdi
lea    0xe0e(%rip),%rsi
mov    $0xc3,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    128d <test_sscanf+0x16d>
jmp    1292 <test_sscanf+0x172>
lea    0xe55(%rip),%rdi
lea    0xdea(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     12e2 <test_sscanf+0x1c2>
lea    0xd3e(%rip),%rdi
lea    0xdc5(%rip),%rsi
mov    $0xc5,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    12e7 <test_sscanf+0x1c7>
jmp    12ec <test_sscanf+0x1cc>
cmpl   $0xfffffffd,-0x8(%rbp)
je     131a <test_sscanf+0x1fa>
lea    0xd06(%rip),%rdi
lea    0xdb7(%rip),%rsi
mov    $0xc6,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    131f <test_sscanf+0x1ff>
jmp    1324 <test_sscanf+0x204>
cmpl   $0x2,-0xc(%rbp)
je     1352 <test_sscanf+0x232>
lea    0xcce(%rip),%rdi
lea    0xd44(%rip),%rsi
mov    $0xc7,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    1357 <test_sscanf+0x237>
jmp    135c <test_sscanf+0x23c>
lea    0xd8b(%rip),%rdi
lea    0xd5b(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     13a8 <test_sscanf+0x288>
lea    0xc78(%rip),%rdi
lea    0xd36(%rip),%rsi
mov    $0xc9,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    13ad <test_sscanf+0x28d>
jmp    13b2 <test_sscanf+0x292>
cmpl   $0xffffffe0,-0x8(%rbp)
je     13e0 <test_sscanf+0x2c0>
lea    0xc40(%rip),%rdi
lea    0xd1d(%rip),%rsi
mov    $0xca,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    13e5 <test_sscanf+0x2c5>
jmp    13ea <test_sscanf+0x2ca>
lea    0xd26(%rip),%rdi
lea    0xccd(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1436 <test_sscanf+0x316>
lea    0xbea(%rip),%rdi
lea    0xcd2(%rip),%rsi
mov    $0xcc,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    143b <test_sscanf+0x31b>
jmp    1440 <test_sscanf+0x320>
cmpl   $0x20,-0x8(%rbp)
je     146e <test_sscanf+0x34e>
lea    0xbb2(%rip),%rdi
lea    0xcb8(%rip),%rsi
mov    $0xcd,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    1473 <test_sscanf+0x353>
jmp    1478 <test_sscanf+0x358>
lea    0xcc5(%rip),%rdi
lea    0xc94(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     14c4 <test_sscanf+0x3a4>
lea    0xb5c(%rip),%rdi
lea    0xc70(%rip),%rsi
mov    $0xcf,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    14c9 <test_sscanf+0x3a9>
jmp    14ce <test_sscanf+0x3ae>
cmpl   $0x40,-0x8(%rbp)
je     14fc <test_sscanf+0x3dc>
lea    0xb24(%rip),%rdi
lea    0xc57(%rip),%rsi
mov    $0xd0,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    1501 <test_sscanf+0x3e1>
jmp    1506 <test_sscanf+0x3e6>
lea    0xc3a(%rip),%rdi
lea    0xc35(%rip),%rsi
lea    -0xd(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1552 <test_sscanf+0x432>
lea    0xace(%rip),%rdi
lea    0xc10(%rip),%rsi
mov    $0xd2,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    1557 <test_sscanf+0x437>
jmp    155c <test_sscanf+0x43c>
movsbl -0xd(%rbp),%eax
cmp    $0x36,%eax
je     158d <test_sscanf+0x46d>
lea    0xa93(%rip),%rdi
lea    0xbf1(%rip),%rsi
mov    $0xd3,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1599 <test_sscanf+0x479>
jmp    1592 <test_sscanf+0x472>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sscanf>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
movb   $0x0,0xb(%rsp)
lea    0xf04(%rip),%rdi
lea    0xeb8(%rip),%rsi
xor    %ebx,%ebx
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    12c5 <test_sscanf+0x1a5>
cmpl   $0x1,0x4(%rsp)
jne    12e2 <test_sscanf+0x1c2>
lea    0xfa6(%rip),%rdi
lea    0xecf(%rip),%rsi
xor    %ebx,%ebx
lea    0x4(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    12ff <test_sscanf+0x1df>
cmpl   $0x3,0x4(%rsp)
jne    131c <test_sscanf+0x1fc>
cmpl   $0x2,0xc(%rsp)
jne    1339 <test_sscanf+0x219>
lea    0xf3d(%rip),%rdi
lea    0xed2(%rip),%rsi
xor    %ebx,%ebx
lea    0x4(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    1356 <test_sscanf+0x236>
cmpl   $0xfffffffd,0x4(%rsp)
jne    1373 <test_sscanf+0x253>
cmpl   $0x2,0xc(%rsp)
jne    1390 <test_sscanf+0x270>
lea    0xefd(%rip),%rdi
lea    0xecd(%rip),%rsi
xor    %ebx,%ebx
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    13ad <test_sscanf+0x28d>
cmpl   $0xffffffe0,0x4(%rsp)
jne    13ca <test_sscanf+0x2aa>
lea    0xef6(%rip),%rdi
lea    0xe9d(%rip),%rsi
xor    %ebx,%ebx
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    13e7 <test_sscanf+0x2c7>
cmpl   $0x20,0x4(%rsp)
jne    1401 <test_sscanf+0x2e1>
lea    0xef3(%rip),%rdi
lea    0xec2(%rip),%rsi
xor    %ebx,%ebx
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    141b <test_sscanf+0x2fb>
cmpl   $0x40,0x4(%rsp)
jne    1435 <test_sscanf+0x315>
lea    0xec6(%rip),%rdi
lea    0xec1(%rip),%rsi
lea    0xb(%rsp),%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    144f <test_sscanf+0x32f>
mov    $0x1,%ebx
cmpb   $0x36,0xb(%rsp)
je     1469 <test_sscanf+0x349>
lea    0xd4f(%rip),%rdi
lea    0xead(%rip),%rsi
mov    $0xd3,%edx
jmp    1462 <test_sscanf+0x342>
lea    0xd37(%rip),%rdi
lea    0xd4e(%rip),%rsi
mov    $0xbe,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xd1a(%rip),%rdi
lea    0xd4e(%rip),%rsi
mov    $0xbf,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xcfd(%rip),%rdi
lea    0xd41(%rip),%rsi
mov    $0xc1,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xce0(%rip),%rdi
lea    0xd4d(%rip),%rsi
mov    $0xc2,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xcc3(%rip),%rdi
lea    0xd39(%rip),%rsi
mov    $0xc3,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xca6(%rip),%rdi
lea    0xd2d(%rip),%rsi
mov    $0xc5,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xc89(%rip),%rdi
lea    0xd3a(%rip),%rsi
mov    $0xc6,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xc6c(%rip),%rdi
lea    0xce2(%rip),%rsi
mov    $0xc7,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xc4f(%rip),%rdi
lea    0xd0d(%rip),%rsi
mov    $0xc9,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xc32(%rip),%rdi
lea    0xd0f(%rip),%rsi
mov    $0xca,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xc15(%rip),%rdi
lea    0xcfd(%rip),%rsi
mov    $0xcc,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xbfb(%rip),%rdi
lea    0xd01(%rip),%rsi
mov    $0xcd,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xbe1(%rip),%rdi
lea    0xcf5(%rip),%rsi
mov    $0xcf,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xbc7(%rip),%rdi
lea    0xcfa(%rip),%rsi
mov    $0xd0,%edx
call   1030 <printf@plt>
jmp    1469 <test_sscanf+0x349>
lea    0xbad(%rip),%rdi
lea    0xcef(%rip),%rsi
mov    $0xd2,%edx
call   1030 <printf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.3 = [29 x i8] c"1 == sscanf(\221\22, \22%d\22, &val)\00"
@.str.4 = [9 x i8] c"val == 1\00"
@.str.5 = [3 x i8] c"32\00"
@.str.6 = [7 x i8] c"%1d%1d\00"
@.str.7 = [41 x i8] c"2 == sscanf(\2232\22, \22%1d%1d\22, &val, &val2)\00"
@.str.8 = [9 x i8] c"val == 3\00"
@.str.9 = [10 x i8] c"val2 == 2\00"
@.str.10 = [4 x i8] c"-32\00"
@.str.11 = [7 x i8] c"%2d%1d\00"
@.str.12 = [42 x i8] c"2 == sscanf(\22-32\22, \22%2d%1d\22, &val, &val2)\00"
@.str.13 = [10 x i8] c"val == -3\00"
@.str.14 = [3 x i8] c"%u\00"
@.str.15 = [31 x i8] c"1 == sscanf(\22-32\22, \22%u\22, &val)\00"
@.str.16 = [11 x i8] c"val == -32\00"
@.str.17 = [30 x i8] c"1 == sscanf(\2232\22, \22%u\22, &val)\00"
@.str.18 = [10 x i8] c"val == 32\00"
@.str.19 = [3 x i8] c"64\00"
@.str.20 = [4 x i8] c"%2u\00"
@.str.21 = [31 x i8] c"1 == sscanf(\2264\22, \22%2u\22, &val)\00"
@.str.22 = [10 x i8] c"val == 64\00"
@.str.23 = [2 x i8] c"6\00"
@.str.24 = [3 x i8] c"%c\00"
@.str.25 = [28 x i8] c"1 == sscanf(\226\22, \22%c\22, &ch)\00"
@.str.26 = [10 x i8] c"ch == '6'\00"
define i32 @test_sscanf() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %2
store i32 0, i32* %3
store i8 0, i8* %4
br label %5
5: ; preds = %0
%6 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = icmp eq i32 1, %6
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 190)
store i32 0, i32* %1
br label %118
10: ; preds = %5
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 191)
store i32 0, i32* %1
br label %118
17: ; preds = %12
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18
%20 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32* %2, i32* %3)
%21 = icmp eq i32 2, %20
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 193)
store i32 0, i32* %1
br label %118
24: ; preds = %19
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 3
br i1 %28, label %31, label %29
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 194)
store i32 0, i32* %1
br label %118
31: ; preds = %26
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 2
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 195)
store i32 0, i32* %1
br label %118
38: ; preds = %33
br label %39
39: ; preds = %38
br label %40
40: ; preds = %39
%41 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32* %2, i32* %3)
%42 = icmp eq i32 2, %41
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), i32 197)
store i32 0, i32* %1
br label %118
45: ; preds = %40
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, -3
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i32 198)
store i32 0, i32* %1
br label %118
52: ; preds = %47
br label %53
53: ; preds = %52
br label %54
54: ; preds = %53
%55 = load i32, i32* %3
%56 = icmp eq i32 %55, 2
br i1 %56, label %59, label %57
57: ; preds = %54
%58 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 199)
store i32 0, i32* %1
br label %118
59: ; preds = %54
br label %60
60: ; preds = %59
br label %61
61: ; preds = %60
%62 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %2)
%63 = icmp eq i32 1, %62
br i1 %63, label %66, label %64
64: ; preds = %61
%65 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.15, i64 0, i64 0), i32 201)
store i32 0, i32* %1
br label %118
66: ; preds = %61
br label %67
67: ; preds = %66
br label %68
68: ; preds = %67
%69 = load i32, i32* %2
%70 = icmp eq i32 %69, -32
br i1 %70, label %73, label %71
71: ; preds = %68
%72 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 202)
store i32 0, i32* %1
br label %118
73: ; preds = %68
br label %74
74: ; preds = %73
br label %75
75: ; preds = %74
%76 = 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.14, i64 0, i64 0), i32* %2)
%77 = icmp eq i32 1, %76
br i1 %77, label %80, label %78
78: ; preds = %75
%79 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0), i32 204)
store i32 0, i32* %1
br label %118
80: ; preds = %75
br label %81
81: ; preds = %80
br label %82
82: ; preds = %81
%83 = load i32, i32* %2
%84 = icmp eq i32 %83, 32
br i1 %84, label %87, label %85
85: ; preds = %82
%86 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 205)
store i32 0, i32* %1
br label %118
87: ; preds = %82
br label %88
88: ; preds = %87
br label %89
89: ; preds = %88
%90 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%91 = icmp eq i32 1, %90
br i1 %91, label %94, label %92
92: ; preds = %89
%93 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0), i32 207)
store i32 0, i32* %1
br label %118
94: ; preds = %89
br label %95
95: ; preds = %94
br label %96
96: ; preds = %95
%97 = load i32, i32* %2
%98 = icmp eq i32 %97, 64
br i1 %98, label %101, label %99
99: ; preds = %96
%100 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), i32 208)
store i32 0, i32* %1
br label %118
101: ; preds = %96
br label %102
102: ; preds = %101
br label %103
103: ; preds = %102
%104 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8* %4)
%105 = icmp eq i32 1, %104
br i1 %105, label %108, label %106
106: ; preds = %103
%107 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i64 0, i64 0), i32 210)
store i32 0, i32* %1
br label %118
108: ; preds = %103
br label %109
109: ; preds = %108
br label %110
110: ; preds = %109
%111 = load i8, i8* %4
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 54
br i1 %113, label %116, label %114
114: ; preds = %110
%115 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i32 211)
store i32 0, i32* %1
br label %118
116: ; preds = %110
br label %117
117: ; preds = %116
store i32 1, i32* %1
br label %118
118: ; preds = %117, %114, %106, %99, %92, %85, %78, %71, %64, %57, %50, %43, %36, %29, %22, %15, %8
%119 = load i32, i32* %1
ret i32 %119
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.3 = [29 x i8] c"1 == sscanf(\221\22, \22%d\22, &val)\00"
@.str.4 = [9 x i8] c"val == 1\00"
@.str.5 = [3 x i8] c"32\00"
@.str.6 = [7 x i8] c"%1d%1d\00"
@.str.7 = [41 x i8] c"2 == sscanf(\2232\22, \22%1d%1d\22, &val, &val2)\00"
@.str.8 = [9 x i8] c"val == 3\00"
@.str.9 = [10 x i8] c"val2 == 2\00"
@.str.10 = [4 x i8] c"-32\00"
@.str.11 = [7 x i8] c"%2d%1d\00"
@.str.12 = [42 x i8] c"2 == sscanf(\22-32\22, \22%2d%1d\22, &val, &val2)\00"
@.str.13 = [10 x i8] c"val == -3\00"
@.str.14 = [3 x i8] c"%u\00"
@.str.15 = [31 x i8] c"1 == sscanf(\22-32\22, \22%u\22, &val)\00"
@.str.16 = [11 x i8] c"val == -32\00"
@.str.17 = [30 x i8] c"1 == sscanf(\2232\22, \22%u\22, &val)\00"
@.str.18 = [10 x i8] c"val == 32\00"
@.str.19 = [3 x i8] c"64\00"
@.str.20 = [4 x i8] c"%2u\00"
@.str.21 = [31 x i8] c"1 == sscanf(\2264\22, \22%2u\22, &val)\00"
@.str.22 = [10 x i8] c"val == 64\00"
@.str.23 = [2 x i8] c"6\00"
@.str.24 = [3 x i8] c"%c\00"
@.str.25 = [28 x i8] c"1 == sscanf(\226\22, \22%c\22, &ch)\00"
@.str.26 = [10 x i8] c"ch == '6'\00"
define i32 @test_sscanf() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
store i8 0, i8* %3
%6 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 190)
br label %85
10: ; preds = %0
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 191)
br label %85
15: ; preds = %10
%16 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32* %1, i32* %2)
%17 = icmp eq i32 %16, 2
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 193)
br label %85
20: ; preds = %15
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, 3
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 194)
br label %85
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 2
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 195)
br label %85
30: ; preds = %25
%31 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32* %1, i32* %2)
%32 = icmp eq i32 %31, 2
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), i32 197)
br label %85
35: ; preds = %30
%36 = load i32, i32* %1
%37 = icmp eq i32 %36, -3
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i32 198)
br label %85
40: ; preds = %35
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 2
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 199)
br label %85
45: ; preds = %40
%46 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %1)
%47 = icmp eq i32 %46, 1
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.15, i64 0, i64 0), i32 201)
br label %85
50: ; preds = %45
%51 = load i32, i32* %1
%52 = icmp eq i32 %51, -32
br i1 %52, label %55, label %53
53: ; preds = %50
%54 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 202)
br label %85
55: ; preds = %50
%56 = 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.14, i64 0, i64 0), i32* %1)
%57 = icmp eq i32 %56, 1
br i1 %57, label %60, label %58
58: ; preds = %55
%59 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0), i32 204)
br label %85
60: ; preds = %55
%61 = load i32, i32* %1
%62 = icmp eq i32 %61, 32
br i1 %62, label %65, label %63
63: ; preds = %60
%64 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 205)
br label %85
65: ; preds = %60
%66 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%67 = icmp eq i32 %66, 1
br i1 %67, label %70, label %68
68: ; preds = %65
%69 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0), i32 207)
br label %85
70: ; preds = %65
%71 = load i32, i32* %1
%72 = icmp eq i32 %71, 64
br i1 %72, label %75, label %73
73: ; preds = %70
%74 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), i32 208)
br label %85
75: ; preds = %70
%76 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8* %3)
%77 = icmp eq i32 %76, 1
br i1 %77, label %80, label %78
78: ; preds = %75
%79 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i64 0, i64 0), i32 210)
br label %85
80: ; preds = %75
%81 = load i8, i8* %3
%82 = icmp eq i8 %81, 54
br i1 %82, label %85, label %83
83: ; preds = %80
%84 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i32 211)
br label %85
85: ; preds = %80, %83, %78, %73, %68, %63, %58, %53, %48, %43, %38, %33, %28, %23, %18, %13, %8
%86 = phi i32 [ 0, %83 ], [ 0, %78 ], [ 0, %73 ], [ 0, %68 ], [ 0, %63 ], [ 0, %58 ], [ 0, %53 ], [ 0, %48 ], [ 0, %43 ], [ 0, %38 ], [ 0, %33 ], [ 0, %28 ], [ 0, %23 ], [ 0, %18 ], [ 0, %13 ], [ 0, %8 ], [ 1, %80 ]
ret i32 %86
}