#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 sscanf(char *, char *, ...);
int t2(void) {
  int result = 0;
  int n;
  long N;
  int retval;
  N = -1;
  retval = sscanf("12345", "%ld", &N);
  printf("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", "12345", "%ld", retval,
         (long int)N);
  result |= retval != 1 || N != 12345;
  N = -1;
  retval = sscanf("12345", "%llllld", &N);
  printf("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", "12345", "%llllld",
         retval, (long int)N);
  result |= retval != 0 || N != -1;
  N = -1;
  retval = sscanf("12345", "%LLLLLd", &N);
  printf("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", "12345", "%LLLLLd",
         retval, (long int)N);
  result |= retval != 0 || N != -1;
  n = -1;
  retval = sscanf("test ", "%*s%n", &n);
  printf("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", "test ", "%*s%n",
         retval, (long int)n);
  result |= retval != 0 || n != 4;
  n = -1;
  retval = sscanf("test ", "%2*s%n", &n);
  printf("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", "test ", "%2*s%n",
         retval, (long int)n);
  result |= retval != 0 || n != -1;
  n = -1;
  retval = sscanf("12 ", "%l2d", &n);
  printf("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", "12 ", "%l2d", retval,
         (long int)n);
  result |= retval != 0 || n != -1;
  N = -1;
  retval = sscanf("12 ", "%2ld", &N);
  printf("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", "12 ", "%2ld", retval,
         (long int)N);
  result |= retval != 1 || N != 12;
  n = -1;
  N = -1;
  retval = sscanf("1 1", "%d %Z", &n, &N);
  printf("sscanf (\"1 1\", \"%%d %%Z\", &n, &N) => %d, n = %d, N = %ld\n",
         retval, n, N);
  result |= retval != 1 || n != 1 || N != -1;
  return result;
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
lea    0xec2(%rip),%rdi
lea    0xec1(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xea9(%rip),%rdi
lea    0xe98(%rip),%rsi
lea    0xe97(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    1193 <t2+0x73>
cmpq   $0x3039,-0x10(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
lea    0xe50(%rip),%rdi
lea    0xe7b(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xe37(%rip),%rdi
lea    0xe26(%rip),%rsi
lea    0xe51(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x16(%rbp)
jne    1202 <t2+0xe2>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
setne  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
lea    0xde1(%rip),%rdi
lea    0xe14(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xdc8(%rip),%rdi
lea    0xdb7(%rip),%rsi
lea    0xdea(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x17(%rbp)
jne    1271 <t2+0x151>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
setne  %al
mov    %al,-0x17(%rbp)
mov    -0x17(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    0xdb5(%rip),%rdi
lea    0xdb4(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
movslq -0x8(%rbp),%r8
lea    0xd5a(%rip),%rdi
lea    0xd8b(%rip),%rsi
lea    0xd8a(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x18(%rbp)
jne    12de <t2+0x1be>
cmpl   $0x4,-0x8(%rbp)
setne  %al
mov    %al,-0x18(%rbp)
mov    -0x18(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    0xd48(%rip),%rdi
lea    0xd4d(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
movslq -0x8(%rbp),%r8
lea    0xced(%rip),%rdi
lea    0xd1e(%rip),%rsi
lea    0xd23(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jne    134b <t2+0x22b>
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    0xcee(%rip),%rdi
lea    0xceb(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
movslq -0x8(%rbp),%r8
lea    0xc80(%rip),%rdi
lea    0xcc4(%rip),%rsi
lea    0xcc1(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x1a(%rbp)
jne    13b8 <t2+0x298>
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
lea    0xc80(%rip),%rdi
lea    0xc82(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xc12(%rip),%rdi
lea    0xc56(%rip),%rsi
lea    0xc58(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x1b(%rbp)
jne    1427 <t2+0x307>
cmpq   $0xc,-0x10(%rbp)
setne  %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
lea    0xc18(%rip),%rdi
lea    0xc15(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xbf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x1c(%rbp)
jne    14a5 <t2+0x385>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x1c(%rbp)
jne    14a5 <t2+0x385>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
setne  %al
mov    %al,-0x1c(%rbp)
mov    -0x1c(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
lea    0xec2(%rip),%rbx
lea    0xec1(%rip),%rbp
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,0x2c(%rsp)
mov    0x10(%rsp),%r8
lea    0xea0(%rip),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    %rax,0x40(%rsp)
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
lea    0xe9c(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,0x28(%rsp)
mov    0x10(%rsp),%r8
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    %rax,0x38(%rsp)
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
lea    0xe5f(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,0x24(%rsp)
mov    0x10(%rsp),%r8
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    %rax,0x30(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xe23(%rip),%rbx
lea    0xe22(%rip),%rbp
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,0x20(%rsp)
movslq 0xc(%rsp),%r8
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%r12d
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xde4(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,0x1c(%rsp)
movslq 0xc(%rsp),%r8
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%r15d
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xdac(%rip),%rbx
lea    0xda9(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,0x18(%rsp)
movslq 0xc(%rsp),%r8
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%r14d
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
lea    0xd6e(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,%r13d
mov    0x10(%rsp),%r8
lea    0xcf9(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rbp
movl   $0xffffffff,0xc(%rsp)
ff
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
lea    0xd26(%rip),%rdi
lea    0xd23(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%rcx
lea    0xd06(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    $0x1,%ebx
mov    0xc(%rsp),%eax
xor    $0x1,%eax
or     %ebx,%eax
setne  %cl
cmpq   $0xffffffffffffffff,0x10(%rsp)
setne  %sil
or     %cl,%sil
cmp    $0x1,%r13d
setne  %dl
cmp    $0xc,%rbp
setne  %cl
or     %dl,%cl
cmpl   $0x1,0x2c(%rsp)
setne  %dl
cmpq   $0x3039,0x40(%rsp)
setne  %bl
or     %dl,%bl
cmpl   $0x0,0x28(%rsp)
setne  %dl
cmpq   $0xffffffffffffffff,0x38(%rsp)
setne  %al
or     %dl,%al
or     %bl,%al
cmpl   $0x0,0x24(%rsp)
setne  %dl
cmpq   $0xffffffffffffffff,0x30(%rsp)
setne  %bl
or     %dl,%bl
xor    $0x4,%r12d
or     0x20(%rsp),%r12d
setne  %dl
or     %bl,%dl
or     %al,%dl
not    %r15d
or     0x1c(%rsp),%r15d
setne  %al
not    %r14d
or     0x18(%rsp),%r14d
setne  %bl
or     %al,%bl
or     %cl,%bl
or     %dl,%bl
or     %sil,%bl
movzbl %bl,%eax
and    $0x1,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [40 x i8] c"sscanf (\22%s\22, \22%s\22, &x) => %d, x = %ld\0A\00"
@.str.3 = [8 x i8] c"%llllld\00"
@.str.4 = [8 x i8] c"%LLLLLd\00"
@.str.5 = [6 x i8] c"test \00"
@.str.6 = [6 x i8] c"%*s%n\00"
@.str.7 = [7 x i8] c"%2*s%n\00"
@.str.8 = [4 x i8] c"12 \00"
@.str.9 = [5 x i8] c"%l2d\00"
@.str.10 = [5 x i8] c"%2ld\00"
@.str.11 = [4 x i8] c"1 1\00"
@.str.12 = [6 x i8] c"%d %Z\00"
@.str.13 = [58 x i8] c"sscanf (\221 1\22, \22%%d %%Z\22, &n, &N) => %d, n = %d, N = %ld\0A\00"
define i32 @t2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
store i64 -1, i64* %3
%5 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %3)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = load i64, i64* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6, i64 %7)
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load i64, i64* %3
%13 = icmp ne i64 %12, 12345
br label %14
14: ; preds = %11, %0
%15 = phi i1 [ true, %0 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = load i32, i32* %1
%18 = or i32 %17, %16
store i32 %18, i32* %1
store i64 -1, i64* %3
%19 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i64* %3)
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = load i64, i64* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %20, i64 %21)
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %14
%26 = load i64, i64* %3
%27 = icmp ne i64 %26, -1
br label %28
28: ; preds = %25, %14
%29 = phi i1 [ true, %14 ], [ %27, %25 ]
%30 = zext i1 %29 to i32
%31 = load i32, i32* %1
%32 = or i32 %31, %30
store i32 %32, i32* %1
store i64 -1, i64* %3
%33 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i64* %3)
store i32 %33, i32* %4
%34 = load i32, i32* %4
%35 = load i64, i64* %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %34, i64 %35)
%37 = load i32, i32* %4
%38 = icmp ne i32 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %28
%40 = load i64, i64* %3
%41 = icmp ne i64 %40, -1
br label %42
42: ; preds = %39, %28
%43 = phi i1 [ true, %28 ], [ %41, %39 ]
%44 = zext i1 %43 to i32
%45 = load i32, i32* %1
%46 = or i32 %45, %44
store i32 %46, i32* %1
store i32 -1, i32* %2
%47 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %2)
store i32 %47, i32* %4
%48 = load i32, i32* %4
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %48, i64 %50)
%52 = load i32, i32* %4
%53 = icmp ne i32 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %42
%55 = load i32, i32* %2
%56 = icmp ne i32 %55, 4
br label %57
57: ; preds = %54, %42
%58 = phi i1 [ true, %42 ], [ %56, %54 ]
%59 = zext i1 %58 to i32
%60 = load i32, i32* %1
%61 = or i32 %60, %59
store i32 %61, i32* %1
store i32 -1, i32* %2
%62 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32* %2)
store i32 %62, i32* %4
%63 = load i32, i32* %4
%64 = load i32, i32* %2
%65 = sext i32 %64 to i64
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %63, i64 %65)
%67 = load i32, i32* %4
%68 = icmp ne i32 %67, 0
br i1 %68, label %72, label %69
69: ; preds = %57
%70 = load i32, i32* %2
%71 = icmp ne i32 %70, -1
br label %72
72: ; preds = %69, %57
%73 = phi i1 [ true, %57 ], [ %71, %69 ]
%74 = zext i1 %73 to i32
%75 = load i32, i32* %1
%76 = or i32 %75, %74
store i32 %76, i32* %1
store i32 -1, i32* %2
%77 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32* %2)
store i32 %77, i32* %4
%78 = load i32, i32* %4
%79 = load i32, i32* %2
%80 = sext i32 %79 to i64
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %78, i64 %80)
%82 = load i32, i32* %4
%83 = icmp ne i32 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %72
%85 = load i32, i32* %2
%86 = icmp ne i32 %85, -1
br label %87
87: ; preds = %84, %72
%88 = phi i1 [ true, %72 ], [ %86, %84 ]
%89 = zext i1 %88 to i32
%90 = load i32, i32* %1
%91 = or i32 %90, %89
store i32 %91, i32* %1
store i64 -1, i64* %3
%92 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64* %3)
store i32 %92, i32* %4
%93 = load i32, i32* %4
%94 = load i64, i64* %3
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %93, i64 %94)
%96 = load i32, i32* %4
%97 = icmp ne i32 %96, 1
br i1 %97, label %101, label %98
98: ; preds = %87
%99 = load i64, i64* %3
%100 = icmp ne i64 %99, 12
br label %101
101: ; preds = %98, %87
%102 = phi i1 [ true, %87 ], [ %100, %98 ]
%103 = zext i1 %102 to i32
%104 = load i32, i32* %1
%105 = or i32 %104, %103
store i32 %105, i32* %1
store i32 -1, i32* %2
store i64 -1, i64* %3
%106 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32* %2, i64* %3)
store i32 %106, i32* %4
%107 = load i32, i32* %4
%108 = load i32, i32* %2
%109 = load i64, i64* %3
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.13, i64 0, i64 0), i32 %107, i32 %108, i64 %109)
%111 = load i32, i32* %4
%112 = icmp ne i32 %111, 1
br i1 %112, label %119, label %113
113: ; preds = %101
%114 = load i32, i32* %2
%115 = icmp ne i32 %114, 1
br i1 %115, label %119, label %116
116: ; preds = %113
%117 = load i64, i64* %3
%118 = icmp ne i64 %117, -1
br label %119
119: ; preds = %116, %113, %101
%120 = phi i1 [ true, %113 ], [ true, %101 ], [ %118, %116 ]
%121 = zext i1 %120 to i32
%122 = load i32, i32* %1
%123 = or i32 %122, %121
store i32 %123, i32* %1
%124 = load i32, i32* %1
ret i32 %124
}

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [40 x i8] c"sscanf (\22%s\22, \22%s\22, &x) => %d, x = %ld\0A\00"
@.str.3 = [8 x i8] c"%llllld\00"
@.str.4 = [8 x i8] c"%LLLLLd\00"
@.str.5 = [6 x i8] c"test \00"
@.str.6 = [6 x i8] c"%*s%n\00"
@.str.7 = [7 x i8] c"%2*s%n\00"
@.str.8 = [4 x i8] c"12 \00"
@.str.9 = [5 x i8] c"%l2d\00"
@.str.10 = [5 x i8] c"%2ld\00"
@.str.11 = [4 x i8] c"1 1\00"
@.str.12 = [6 x i8] c"%d %Z\00"
@.str.13 = [58 x i8] c"sscanf (\221 1\22, \22%%d %%Z\22, &n, &N) => %d, n = %d, N = %ld\0A\00"
define i32 @t2() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 -1, i64* %2
%5 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%6 = load i64, i64* %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5, i64 %6)
%8 = load i64, i64* %2
store i64 -1, i64* %2
%9 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i64* %2)
%10 = load i64, i64* %2
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %9, i64 %10)
%12 = load i64, i64* %2
store i64 -1, i64* %2
%13 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i64* %2)
%14 = load i64, i64* %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %13, i64 %14)
%16 = load i64, i64* %2
store i32 -1, i32* %1
%17 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = sext i32 %18 to i64
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %17, i64 %19)
%21 = load i32, i32* %1
store i32 -1, i32* %1
%22 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32* %1)
%23 = load i32, i32* %1
%24 = sext i32 %23 to i64
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %22, i64 %24)
%26 = load i32, i32* %1
store i32 -1, i32* %1
%27 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%28 = load i32, i32* %1
%29 = sext i32 %28 to i64
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %27, i64 %29)
%31 = load i32, i32* %1
store i64 -1, i64* %2
%32 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64* %2)
%33 = load i64, i64* %2
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %32, i64 %33)
%35 = load i64, i64* %2
store i32 -1, i32* %1
store i64 -1, i64* %2
%36 = call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32* %1, i64* %2)
%37 = load i32, i32* %1
%38 = load i64, i64* %2
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.13, i64 0, i64 0), i32 %36, i32 %37, i64 %38)
%40 = icmp ne i32 %36, 1
%41 = load i32, i32* %1
%42 = icmp ne i32 %41, 1
%43 = select i1 %40, i1 true, i1 %42
%44 = load i64, i64* %2
%45 = icmp ne i64 %44, -1
%46 = select i1 %43, i1 true, i1 %45
%47 = icmp ne i32 %32, 1
%48 = icmp ne i64 %35, 12
%49 = select i1 %47, i1 true, i1 %48
%50 = icmp ne i32 %5, 1
%51 = icmp ne i64 %8, 12345
%52 = select i1 %50, i1 true, i1 %51
%53 = icmp ne i32 %9, 0
%54 = icmp ne i64 %12, -1
%55 = select i1 %53, i1 true, i1 %54
%56 = or i1 %52, %55
%57 = icmp ne i32 %13, 0
%58 = icmp ne i64 %16, -1
%59 = select i1 %57, i1 true, i1 %58
%60 = or i1 %56, %59
%61 = icmp ne i32 %17, 0
%62 = icmp ne i32 %21, 4
%63 = select i1 %61, i1 true, i1 %62
%64 = or i1 %60, %63
%65 = icmp ne i32 %22, 0
%66 = icmp ne i32 %26, -1
%67 = select i1 %65, i1 true, i1 %66
%68 = or i1 %64, %67
%69 = icmp ne i32 %27, 0
%70 = icmp ne i32 %31, -1
%71 = select i1 %69, i1 true, i1 %70
%72 = or i1 %68, %71
%73 = or i1 %72, %49
%74 = or i1 %73, %46
%75 = zext i1 %74 to i32
ret i32 %75
}