#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*/ abort();
int /*<<< orphan*/ printf(char *, int, int, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, ...);
int main(int argc, char *argv[]) {
  int point, x, y;
  point = x = y = -1;
  sscanf("0x10 10", "%x %x", &x, &y);
  printf("%d %d\n", x, y);
  if (x != 0x10 || y != 0x10)
    abort();
  point = x = y = -1;
  sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y);
  printf("%d %d %d\n", point, x, y);
  if (point != 0 || x != 1234 || y != 9876)
    abort();
  point = x = y = -1;
  sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y);
  printf("%d %d %d\n", point, x, y);
  if (point != 1 || x != 1234 || y != 9876)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    0xe9e(%rip),%rdi
lea    0xe9f(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x10,-0x18(%rbp)
jne    11a0 <main+0x70>
cmpl   $0x10,-0x1c(%rbp)
je     11a7 <main+0x77>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    0xe4b(%rip),%rdi
lea    0xe4f(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1218 <main+0xe8>
cmpl   $0x4d2,-0x18(%rbp)
jne    1218 <main+0xe8>
cmpl   $0x2694,-0x1c(%rbp)
je     121f <main+0xef>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    0xdf3(%rip),%rdi
lea    0xdd7(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1290 <main+0x160>
cmpl   $0x4d2,-0x18(%rbp)
jne    1290 <main+0x160>
cmpl   $0x2694,-0x1c(%rbp)
je     1297 <main+0x167>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0xffffffff,0xc(%rsp)
ff
movl   $0xffffffff,0x10(%rsp)
ff
lea    0xeb5(%rip),%rdi
lea    0xeb6(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x10,0x10(%rsp)
jne    1280 <main+0x150>
cmpl   $0x10,0xc(%rsp)
jne    1280 <main+0x150>
movl   $0xffffffff,0xc(%rsp)
ff
movl   $0xffffffff,0x10(%rsp)
ff
movl   $0xffffffff,0x14(%rsp)
ff
lea    0xe60(%rip),%rdi
lea    0xe64(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe46(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x14(%rsp)
jne    1280 <main+0x150>
cmpl   $0x4d2,0x10(%rsp)
jne    1280 <main+0x150>
cmpl   $0x2694,0xc(%rsp)
jne    1280 <main+0x150>
movl   $0xffffffff,0xc(%rsp)
ff
movl   $0xffffffff,0x10(%rsp)
ff
movl   $0xffffffff,0x14(%rsp)
ff
lea    0xe07(%rip),%rdi
lea    0xdeb(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xdcd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x1,0x14(%rsp)
jne    1280 <main+0x150>
cmpl   $0x4d2,0x10(%rsp)
jne    1280 <main+0x150>
cmpl   $0x2694,0xc(%rsp)
jne    1280 <main+0x150>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"0x10 10\00"
@.str.1 = [6 x i8] c"%x %x\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
@.str.3 = [11 x i8] c"P012349876\00"
@.str.4 = [11 x i8] c"P%1d%4d%4d\00"
@.str.5 = [10 x i8] c"%d %d %d\0A\00"
@.str.6 = [11 x i8] c"P112349876\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %8
store i32 -1, i32* %7
store i32 -1, i32* %6
%9 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %7, i32* %8)
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %7
%14 = icmp ne i32 %13, 16
br i1 %14, label %18, label %15
15: ; preds = %2
%16 = load i32, i32* %8
%17 = icmp ne i32 %16, 16
br i1 %17, label %18, label %20
18: ; preds = %15, %2
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %15
store i32 -1, i32* %8
store i32 -1, i32* %7
store i32 -1, i32* %6
%21 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 0
br i1 %27, label %34, label %28
28: ; preds = %20
%29 = load i32, i32* %7
%30 = icmp ne i32 %29, 1234
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = load i32, i32* %8
%33 = icmp ne i32 %32, 9876
br i1 %33, label %34, label %36
34: ; preds = %31, %28, %20
%35 = call i32 (...) @abort()
unreachable
36: ; preds = %31
store i32 -1, i32* %8
store i32 -1, i32* %7
store i32 -1, i32* %6
%37 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %38, i32 %39, i32 %40)
%42 = load i32, i32* %6
%43 = icmp ne i32 %42, 1
br i1 %43, label %50, label %44
44: ; preds = %36
%45 = load i32, i32* %7
%46 = icmp ne i32 %45, 1234
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load i32, i32* %8
%49 = icmp ne i32 %48, 9876
br i1 %49, label %50, label %52
50: ; preds = %47, %44, %36
%51 = call i32 (...) @abort()
unreachable
52: ; preds = %47
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x10 10\00"
@.str.1 = [6 x i8] c"%x %x\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
@.str.3 = [11 x i8] c"P012349876\00"
@.str.4 = [11 x i8] c"P%1d%4d%4d\00"
@.str.5 = [10 x i8] c"%d %d %d\0A\00"
@.str.6 = [11 x i8] c"P112349876\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
store i32 -1, i32* %5
store i32 -1, i32* %4
%9 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 16
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 16
%17 = select i1 %14, i1 true, i1 %16
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %2
store i32 -1, i32* %5
store i32 -1, i32* %4
store i32 -1, i32* %3
%21 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* %3
%27 = icmp ne i32 %26, 0
%28 = load i32, i32* %4
%29 = icmp ne i32 %28, 1234
%30 = select i1 %27, i1 true, i1 %29
%31 = load i32, i32* %5
%32 = icmp ne i32 %31, 9876
%33 = select i1 %30, i1 true, i1 %32
br i1 %33, label %34, label %36
34: ; preds = %20
%35 = call i32 (...) @abort()
unreachable
36: ; preds = %20
store i32 -1, i32* %5
store i32 -1, i32* %4
store i32 -1, i32* %3
%37 = call i32 (i8*, i8*, i32*, i32*, ...) @sscanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%38 = load i32, i32* %3
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %38, i32 %39, i32 %40)
%42 = load i32, i32* %3
%43 = icmp ne i32 %42, 1
%44 = load i32, i32* %4
%45 = icmp ne i32 %44, 1234
%46 = select i1 %43, i1 true, i1 %45
%47 = load i32, i32* %5
%48 = icmp ne i32 %47, 9876
%49 = select i1 %46, i1 true, i1 %48
br i1 %49, label %50, label %52
50: ; preds = %36
%51 = call i32 (...) @abort()
unreachable
52: ; preds = %36
ret i32 0
}