#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*/ getchar();
int /*<<< orphan*/ login();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ regist();
int /*<<< orphan*/ scanf(char *, char *);
int my_log() {
  char flag;
  printf("are you want login or regist(l/r)\n");
  scanf("%c", &flag);
  getchar();
  switch (flag) {
  case 'l':
    login();
    break;
  case 'r':
    regist();
    break;
  default:
    printf("error input\n");
    my_log();
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x6c,%eax
je     11b1 <my_log+0x51>
jmp    11a0 <my_log+0x40>
mov    -0x8(%rbp),%eax
sub    $0x72,%eax
je     11bd <my_log+0x5d>
jmp    11c9 <my_log+0x69>
mov    $0x0,%al
call   1050 <login@plt>
jmp    11da <my_log+0x7a>
mov    $0x0,%al
call   1030 <regist@plt>
jmp    11da <my_log+0x7a>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
call   1080 <my_log@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_log>:
push   %rax
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
movsbl 0x7(%rsp),%eax
cmp    $0x72,%eax
je     119d <my_log+0x3d>
cmp    $0x6c,%eax
jne    11a6 <my_log+0x46>
xor    %eax,%eax
call   1050 <login@plt>
jmp    11b7 <my_log+0x57>
xor    %eax,%eax
call   1040 <regist@plt>
jmp    11b7 <my_log+0x57>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
call   1080 <my_log@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"are you want login or regist(l/r)\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [13 x i8] c"error input\0A\00"
define i32 @my_log() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = call i32 (...) @getchar()
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
switch i32 %6, label %11 [
i32 108, label %7
i32 114, label %9
]
7: ; preds = %0
%8 = call i32 (...) @login()
br label %14
9: ; preds = %0
%10 = call i32 (...) @regist()
br label %14
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @my_log()
br label %14
14: ; preds = %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@str = [34 x i8] c"are you want login or regist(l/r)\00"
@str.3 = [12 x i8] c"error input\00"
define i32 @my_log() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = call i32 (...) @getchar()
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
switch i32 %6, label %11 [
i32 108, label %7
i32 114, label %9
]
7: ; preds = %0
%8 = call i32 (...) @login()
br label %14
9: ; preds = %0
%10 = call i32 (...) @regist()
br label %14
11: ; preds = %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%13 = call i32 @my_log()
br label %14
14: ; preds = %11, %9, %7
ret i32 0
}