#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*/ func(char *);
int /*<<< orphan*/ func2(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char hex_des;
  char hex_str[100];
  scanf("%c", &hex_des);
  if (hex_des == 'd') {
    scanf("%s", hex_str);
    func(hex_str);
  } else if (hex_des == 'h') {
    scanf("%s", hex_str);
    func2(hex_str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    117a <main+0x4a>
lea    -0x70(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <func@plt>
jmp    11a5 <main+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x68,%eax
jne    11a0 <main+0x70>
lea    -0x70(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <func2@plt>
jmp    11a5 <main+0x75>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xec1(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xf(%rsp),%al
cmp    $0x68,%al
je     1173 <main+0x43>
cmp    $0x64,%al
jne    118f <main+0x5f>
lea    0xea7(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <func@plt>
jmp    118f <main+0x5f>
lea    0xe89(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <func2@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 100
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @func(i8* %11)
br label %23
13: ; preds = %0
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 104
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%21 = call i32 @func2(i8* %20)
br label %22
22: ; preds = %17, %13
br label %23
23: ; preds = %22, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
switch i8 %5, label %12 [
i8 100, label %6
i8 104, label %9
]
6: ; preds = %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = call i32 @func(i8* %3)
br label %12
9: ; preds = %0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%11 = call i32 @func2(i8* %3)
br label %12
12: ; preds = %0, %9, %6
ret i32 0
}