#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 */
scalar_t__ checkId(char *);
scalar_t__ checkIdPw(char *, char *);
int /*<<< orphan*/ createIdPw(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ setBlindInput(int);
int main() {
  int input = 0;
  char id[80];
  char pw[80];
  while (1) {
    puts("====Select Menu====");
    puts("1. Make ID&PW");
    puts("2. Login");
    puts("3. Exit");
    puts("===================");
    scanf("%d", &input);
    if (input == 3)
      break;
    if (input == 1) {
      printf("ID : ");
      scanf("%s", id);
      printf("PW : ");
      setBlindInput(1);
      scanf("%s", pw);
      setBlindInput(0);
      createIdPw(id, pw);
    }
    if (input == 2) {
      printf("ID : ");
      scanf("%s", id);
      if (checkId(id)) {
        for (int i = 0; i < 3; i++) {
          printf("PW : ");
          setBlindInput(1);
          scanf("%s", pw);
          setBlindInput(0);
          if (checkIdPw(id, pw)) {
            puts("Login Success");
            break;
          } else {
            printf("Wrong Password : count %d\n", i + 1);
            continue;
          }
        }
      } else {
        puts("ID does not exist");
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
lea    0xe78(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe77(%rip),%rdi
call   1040 <puts@plt>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7b(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
cmpl   $0x3,-0x8(%rbp)
jne    11e6 <main+0x76>
jmp    134d <main+0x1dd>
cmpl   $0x1,-0x8(%rbp)
jne    1254 <main+0xe4>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1080 <setBlindInput@plt>
lea    -0xb0(%rbp),%rsi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
xor    %edi,%edi
call   1080 <setBlindInput@plt>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1050 <createIdPw@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1348 <main+0x1d8>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <checkId@plt>
cmp    $0x0,%rax
je     1337 <main+0x1c7>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x3,-0xb4(%rbp)
jge    1332 <main+0x1c2>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1080 <setBlindInput@plt>
lea    -0xb0(%rbp),%rsi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
xor    %edi,%edi
call   1080 <setBlindInput@plt>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1090 <checkIdPw@plt>
cmp    $0x0,%rax
je     1307 <main+0x197>
lea    0xd5c(%rip),%rdi
call   1040 <puts@plt>
jmp    1332 <main+0x1c2>
mov    -0xb4(%rbp),%esi
add    $0x1,%esi
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    129b <main+0x12b>
jmp    1343 <main+0x1d3>
lea    0xd44(%rip),%rdi
call   1040 <puts@plt>
jmp    1348 <main+0x1d8>
jmp    1189 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
movl   $0x0,0xc(%rsp)
lea    0xea3(%rip),%r12
lea    0xeb0(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xead(%rip),%rbp
lea    0x60(%rsp),%r13
lea    0x10(%rsp),%r15
jmp    11c1 <main+0x51>
nop
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rbx
lea    0xe38(%rip),%rdi
call   1040 <puts@plt>
lea    0xe40(%rip),%rdi
call   1040 <puts@plt>
lea    0xe42(%rip),%rdi
call   1040 <puts@plt>
lea    0xe3f(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x1,%eax
je     1220 <main+0xb0>
cmp    $0x3,%eax
je     13ba <main+0x24a>
cmp    $0x2,%eax
jne    11c1 <main+0x51>
jmp    127f <main+0x10f>
nop
lea    0xe23(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe11(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   1080 <setBlindInput@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %edi,%edi
call   1080 <setBlindInput@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <createIdPw@plt>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
jne    11c1 <main+0x51>
lea    0xdc4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %r13,%rdi
call   1030 <checkId@plt>
test   %rax,%rax
je     13a9 <main+0x239>
lea    0xda1(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   1080 <setBlindInput@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %edi,%edi
call   1080 <setBlindInput@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1090 <checkIdPw@plt>
test   %rax,%rax
jne    11b0 <main+0x40>
lea    0xd72(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   1080 <setBlindInput@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %edi,%edi
call   1080 <setBlindInput@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1090 <checkIdPw@plt>
test   %rax,%rax
jne    11b0 <main+0x40>
lea    0xd23(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   1080 <setBlindInput@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %edi,%edi
call   1080 <setBlindInput@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1090 <checkIdPw@plt>
test   %rax,%rax
jne    11b0 <main+0x40>
lea    0xcd4(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc(%rsp),%rbx
jmp    11c1 <main+0x51>
lea    0xcd2(%rip),%rdi
call   1040 <puts@plt>
jmp    11c1 <main+0x51>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"====Select Menu====\00"
@.str.1 = [14 x i8] c"1. Make ID&PW\00"
@.str.2 = [9 x i8] c"2. Login\00"
@.str.3 = [8 x i8] c"3. Exit\00"
@.str.4 = [20 x i8] c"===================\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [6 x i8] c"ID : \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [6 x i8] c"PW : \00"
@.str.9 = [14 x i8] c"Login Success\00"
@.str.10 = [27 x i8] c"Wrong Password : count %d\0A\00"
@.str.11 = [18 x i8] c"ID does not exist\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %0, %68
%7 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %16
15: ; preds = %6
br label %69
16: ; preds = %6
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %31
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%24 = call i32 @setBlindInput(i32 1)
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %25)
%27 = call i32 @setBlindInput(i32 0)
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%30 = call i32 @createIdPw(i8* %28, i8* %29)
br label %31
31: ; preds = %19, %16
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 2
br i1 %33, label %34, label %68
34: ; preds = %31
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%36 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%39 = call i64 @checkId(i8* %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %65
41: ; preds = %34
store i32 0, i32* %5
br label %42
42: ; preds = %61, %41
%43 = load i32, i32* %5
%44 = icmp slt i32 %43, 3
br i1 %44, label %45, label %64
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%47 = call i32 @setBlindInput(i32 1)
%48 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %48)
%50 = call i32 @setBlindInput(i32 0)
%51 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%52 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%53 = call i64 @checkIdPw(i8* %51, i8* %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %45
%56 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %64
57: ; preds = %45
%58 = load i32, i32* %5
%59 = add nsw i32 %58, 1
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %57
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
br label %42
64: ; preds = %55, %42
br label %67
65: ; preds = %34
%66 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
br label %67
67: ; preds = %65, %64
br label %68
68: ; preds = %67, %31
br label %6
69: ; preds = %15
%70 = load i32, i32* %1
ret i32 %70
}

LLVM IR (-O2):
@.str = [20 x i8] c"====Select Menu====\00"
@.str.1 = [14 x i8] c"1. Make ID&PW\00"
@.str.2 = [9 x i8] c"2. Login\00"
@.str.3 = [8 x i8] c"3. Exit\00"
@.str.4 = [20 x i8] c"===================\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [6 x i8] c"ID : \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [6 x i8] c"PW : \00"
@.str.9 = [14 x i8] c"Login Success\00"
@.str.10 = [27 x i8] c"Wrong Password : count %d\0A\00"
@.str.11 = [18 x i8] c"ID does not exist\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
br label %7
7: ; preds = %59, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
switch i32 %14, label %24 [
i32 3, label %62
i32 1, label %15
]
15: ; preds = %7
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %5)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%19 = call i32 @setBlindInput(i32 1)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%21 = call i32 @setBlindInput(i32 0)
%22 = call i32 @createIdPw(i8* %5, i8* %6)
%23 = load i32, i32* %1
br label %24
24: ; preds = %7, %15
%25 = phi i32 [ %14, %7 ], [ %23, %15 ]
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %59
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %5)
%30 = call i64 @checkId(i8* %5)
%31 = icmp eq i64 %30, 0
br i1 %31, label %60, label %32
32: ; preds = %27
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%34 = call i32 @setBlindInput(i32 1)
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%36 = call i32 @setBlindInput(i32 0)
%37 = call i64 @checkIdPw(i8* %5, i8* %6)
%38 = icmp eq i64 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %49, %41, %32
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %59
41: ; preds = %32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 1)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%44 = call i32 @setBlindInput(i32 1)
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%46 = call i32 @setBlindInput(i32 0)
%47 = call i64 @checkIdPw(i8* %5, i8* %6)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %39
49: ; preds = %41
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 2)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%52 = call i32 @setBlindInput(i32 1)
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%54 = call i32 @setBlindInput(i32 0)
%55 = call i64 @checkIdPw(i8* %5, i8* %6)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %39
57: ; preds = %49
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 3)
br label %59
59: ; preds = %57, %39, %60, %24
br label %7
60: ; preds = %27
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
br label %59
62: ; preds = %7
ret i32 0
}