#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int getsn1(char *);
int getsn2(char *);
int getsn3(char *);
int getsn4(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
void main() {
  char *str;
  printf("\nplease input the serial number:\n");
  scanf("%s", str);
  if (strlen(str) == 23 && str[5] == '-' && str[11] == '-' && str[17] == '-') {
    if (getsn1(str) % 6 == 1 && getsn2(str) % 8 == 1 && getsn3(str) % 9 == 2 &&
        getsn4(str) % 3 == 0)
      printf("register succeed");
    else
      printf("register lose");
    getch();
    exit(0);
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x17,%eax
jne    128c <main+0xfc>
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%eax
cmp    $0x2d,%eax
jne    128c <main+0xfc>
mov    -0x8(%rbp),%rax
movsbl 0xb(%rax),%eax
cmp    $0x2d,%eax
jne    128c <main+0xfc>
mov    -0x8(%rbp),%rax
movsbl 0x11(%rax),%eax
cmp    $0x2d,%eax
jne    128c <main+0xfc>
mov    -0x8(%rbp),%rdi
call   10b0 <getsn1@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1272 <main+0xe2>
mov    -0x8(%rbp),%rdi
call   1050 <getsn2@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1272 <main+0xe2>
mov    -0x8(%rbp),%rdi
call   10a0 <getsn3@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    1272 <main+0xe2>
mov    -0x8(%rbp),%rdi
call   1060 <getsn4@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1272 <main+0xe2>
lea    0xdbd(%rip),%rdi
call   1040 <printf@plt>
jmp    127e <main+0xee>
lea    0xdbd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <getch@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    $0x0,%al
call   1080 <getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
call   1040 <strlen@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <getch@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0Aplease input the serial number:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [17 x i8] c"register succeed\00"
@.str.3 = [14 x i8] c"register lose\00"
define void @main() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 23
br i1 %7, label %8, label %53
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = getelementptr inbounds i8, i8* %9, i64 5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br i1 %13, label %14, label %53
14: ; preds = %8
%15 = load i8*, i8** %1
%16 = getelementptr inbounds i8, i8* %15, i64 11
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 45
br i1 %19, label %20, label %53
20: ; preds = %14
%21 = load i8*, i8** %1
%22 = getelementptr inbounds i8, i8* %21, i64 17
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 45
br i1 %25, label %26, label %53
26: ; preds = %20
%27 = load i8*, i8** %1
%28 = call i32 @getsn1(i8* %27)
%29 = srem i32 %28, 6
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %48
31: ; preds = %26
%32 = load i8*, i8** %1
%33 = call i32 @getsn2(i8* %32)
%34 = srem i32 %33, 8
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %48
36: ; preds = %31
%37 = load i8*, i8** %1
%38 = call i32 @getsn3(i8* %37)
%39 = srem i32 %38, 9
%40 = icmp eq i32 %39, 2
br i1 %40, label %41, label %48
41: ; preds = %36
%42 = load i8*, i8** %1
%43 = call i32 @getsn4(i8* %42)
%44 = srem i32 %43, 3
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %50
48: ; preds = %41, %36, %31, %26
%49 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %48, %46
%51 = call i32 (...) @getch()
%52 = call i32 @exit(i32 0)
unreachable
53: ; preds = %20, %14, %8, %0
%54 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [33 x i8] c"\0Aplease input the serial number:\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* undef)
%3 = tail call i32 @strlen(i8* undef)
%4 = tail call i32 (...) @getch()
ret void
}